my-snippets(支付宝小程序snippets)

my-snippets(支付宝小程序snippets) 0.0.3

分类:工具软件

版本:0.0.3

浏览:42

日期:06.12

my-snippets是一款专为支付宝小程序开发者设计的代码片段工具,简化开发流程。通过CommandPalette安装,提供多种常用API的快捷代码片段,如toast、alert、loading等,提升开发效率。

立即下载

my-snippets是一款专为支付宝小程序开发者设计的代码片段工具,旨在简化开发流程,提升开发效率。通过Command Palette(Ctrl Shift P或Cmd Shift P)即可轻松安装,提供多种常用API的快捷代码片段,帮助开发者快速生成所需代码。

安装指南:

要安装my-snippets扩展,只需启动Command Palette(快捷键为Ctrl Shift P或Cmd Shift P),然后输入my-snippets。您可以选择查看已安装的代码片段或安装新的片段。

代码片段列表:

以下是my-snippets提供的所有代码片段及其触发方式。→表示按下Enter键。

触发词内容
[toast,showToast,my.toast, my.showToast]→my.showToast({content:''})
[alert, my.alert]→my.alert({content: ''})
[loading, showLoading,my.showLoading]→my.showLoading({content: ''})
[reLaunch,my.reLaunch]→my.reLaunch({url: ''})
[redirect,redirectTo, my.redirectTo]→my.redirectTo({url:''})
[navigate,navigateTo, my.navigateTo]→my.navigateTo({url: ''})
openUrl→openUrl({url: ''})
setData→my.setData({'': ''})
[create,createSelector,createSelectorQuery,my.create]→my.createSelectorQuery().select('').boundingClientRect().exec(rets => {})
[storage,setStorage,my.setStorage]→my.setStorage({key: '', data: '', success: (res)=>{}, fail: (cause) => {}})
[setStorageSync,my.setStorageSync]→my.setStorageSync('key', 'value')
[storage,getStorage,my.getStorage]→my.getStorage({key: '', success: (res)=>{}, fail: (cause) => {}})
[getStorageSync,my.getStorageSync]→my.getStorageSync('key')
[removeStorage,my.removeStorage]→my.removeStorage({key: '', success: (res)=>{}, fail: (cause) => {}})
[removeStorageSync,my.removeStorageSync]→my.removeStorageSync('key')
[clearStorage,my.clearStorage]→my.clearStorage({success: (res)=>{}, fail: (cause) => {}})
[clearStorageSync,my.clearStorageSync]→my.clearStorageSync()
[confirm,my.confirm]→my.confirm({title: '', content: '', confirmButtonText: '', cancelButtonText: '', success: (result) => {}})

使用示例:

  • createSelectorQuery:
my.createSelectorQuery()
        .select('')
        .boundingClientRect()
        .exec(rets => {
          if (rets && rets[0]) {

          }
        }) 
  • setStorage:
my.setStorage({
          key: '',
          data: '',
          success: (res)=>{},
          fail: (cause) => {},
        })
  • confirm:
my.confirm({
          title: '',
          content: '',
          confirmButtonText: '',
          cancelButtonText: '',
          success: (result) => {
          },
        })   

my-snippets通过提供这些常用API的代码片段,帮助开发者快速生成所需代码,显著提升开发效率,是支付宝小程序开发者的必备工具。

最新下载

更多 ›

相关文章

更多 ›

课程推荐

更多 ›
首页