小程式開發利器:Matchmaker

lypeer發表於2019-02-17

Matchmaker

先上GayHub地址:Matchmaker。歡迎前去 star 或是提 issue 哈。

這是一款專為微信小程式開發的外掛,目前可在 IntelliJ IDEA 中使用。它可以幫你完成重複機械無趣麻煩的繫結方法的過程,自動的將需要新建的方法注入到 js 檔案中去。

PS:其實我本來的目的是做一個能在 WebStorm 裡面使用的外掛的,但是沒想到做出來之後反而沒辦法在 WebStorm 用,只能在 IntelliJ IDEA 裡用,如果有哥們兒知道怎麼搞的話請告知一下,感激不盡。

GIF展示

這是在 IntelliJ IDEA 中外掛的展示效果

在 IntelliJ IDEA 中的展示

裝載外掛

不知道為什麼,我把外掛上傳到 JetBrains Plugins Repository 之後它就一直處於 Wait for approve 的階段,截止目前都是如此,也就是說現在要用的話就只能下載 jar 包然後裝載本地外掛了,jar 包在這裡

作用

我們都知道,在開發微信小程式的時候,wxmljs 之間如果要有事件響應的話,是要先在 wxmlbind***/catch*** 標籤繫結一個方法,然後在 js 裡面一個一個去把 wxml 裡面定義的方法寫出來的。

這個寫空方法的過程其實很無聊,就跟 Android 裡面的 findViewById 一樣。想一下如果一個比較複雜的頁面有十幾個甚至幾十個繫結的方法,那寫起來多尷尬。這個外掛就是用來把 wxml 裡面宣告的方法直接注入到 js 裡面的,自動生成程式碼,讓我們可以把時間和精力花在更有技術含量的地方。

用法

用法非常的簡單,直接在 JS 程式碼點選右鍵,然後 Generate -> Match make 就可以了。當然你可以為這個功能設定一個快捷鍵,讓它更加方便。

開源協議

  Copyright 2014-2016 lypeer.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.複製程式碼

再上 GayHub 地址:Matchmaker。歡迎前去 star 或是提 issue 哈。

相關文章