Wepy是 一個(gè)小程序的組件化開發(fā)框架。
n stable 安裝 穩(wěn)定版本的node.js (node-v7.10.0 當(dāng)前時(shí)間穩(wěn)定版本)
查看 node.js 版本
$ n
安裝最新的版本
$ n latest
安裝穩(wěn)定版本
$ n stable
刪除某個(gè)版本
$ n rm 0.10.1
以指定的版本來執(zhí)行腳本
$ n use 0.10.21 some.js
nvm
nvm全稱Node Version Manager,它與n
的實(shí)現(xiàn)方式不同帖汞,其是通過shell腳本實(shí)現(xiàn)的耸峭。
.wpy 接口
<style lang="less">
</style>
<template>
<view class="container">
<view>
<toast />
</view>
</template>
<script>
import wepy from 'wepy'
import List from '../components/list'
import Panel from '../components/panel'
import Counter from '../components/counter'
import Group from '../components/group'
import Toast from 'wepy-com-toast'
import testMixin from '../mixins/test'
export default class Index extends wepy.page {
config = {
navigationBarTitleText: '專家回復(fù)'
}
components = {
panel: Panel,
counter1: Counter,
counter2: Counter,
list: List,
group: Group,
toast: Toast
}
mixins = [testMixin]
data = {
}
methods = {
/**
* 輸入監(jiān)聽器 自定義方法
* 自動(dòng)映射到 content
* @param {Event} e 輸入事件
*/
inputChange (e) {
this.content = e.detail.value
this.disabled = e.detail.value === ''
console.log(this.content)
},
}
onLoad() {
}
}
</script>
常見錯(cuò)誤:
error Missing space before value for key 'mypages' key-spacing
在鍵與值之間缺少空格
image.png
error A space is required after ',' comma-spacing
引入文件時(shí)峡继,在岸梨, 之后缺少空格
常量 的引入
image.png
error Unexpected trailing comma comma-dangle
date 數(shù)據(jù)元暴,逗號(hào)異常篷扩。