@abtasty/ff-widget-voucher 中文文档教程

发布于 3年前 浏览 24 项目主页 更新于 3年前

voucher

这个小部件是使用 AB Tasty Widget CLI 生成的。 您可以在 https://abtasty.gitbooks.io/widget/ 找到有关小部件的更多信息和文档。

Preview your widget

在新窗口中启动您的小部件并观察变化。

npm start

Main files

  • main.js Main source code of your widget
  • form.js Configuration form for your widget
  • icon.png Icon for your widget (recommended size: 200x200px)

您可以像这样在 package.json 中指定每个文件位置:

  "main": "dist/main.js",
  "form": "dist/form.js",
  "icon": "icon.png",

Included

我们听说您的小部件有一个 UI,所以我们允许自己包含一些额外的内容:

  • Pug (aka Jade) to transforms html files into JS template.
  • PostCSS to automatically append your CSS to head just using import 'yourstyle.css' and also use CSS plugins including:
  • CSSnext to use the latest CSS syntax today.
  • cssnano to minify CSS.

Add your widget to AB Tasty

  1. First, you'll need to have your widget on NPM:
    • Create a minified bundle with npm run build
    • Bump the version of your widget (using semver) with npm version [patch|minor|major]
    • Publish it to NPM: npm publish
  2. Once your widget is on NPM, you can now add it on AB Tasty at https://marketplace.abtasty.com/publish.

voucher

This widget was generated using AB Tasty Widget CLI. You can find more infomation and documentation about widgets at https://abtasty.gitbooks.io/widget/.

Preview your widget

Launch your widget in a new window and watch for changes.

npm start

Main files

  • main.js Main source code of your widget
  • form.js Configuration form for your widget
  • icon.png Icon for your widget (recommended size: 200x200px)

You can specify each file location in the package.json like this:

  "main": "dist/main.js",
  "form": "dist/form.js",
  "icon": "icon.png",

Included

We heard your widget have an UI, so we allowed ourselves to include some extra:

  • Pug (aka Jade) to transforms html files into JS template.
  • PostCSS to automatically append your CSS to head just using import 'yourstyle.css' and also use CSS plugins including:
  • CSSnext to use the latest CSS syntax today.
  • cssnano to minify CSS.

Add your widget to AB Tasty

  1. First, you'll need to have your widget on NPM:
    • Create a minified bundle with npm run build
    • Bump the version of your widget (using semver) with npm version [patch|minor|major]
    • Publish it to NPM: npm publish
  2. Once your widget is on NPM, you can now add it on AB Tasty at https://marketplace.abtasty.com/publish.
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文