接上一節index頁面的代碼
main.js(掛載index頁面)
import Vue from 'vue'
import Index from './Index.vue'
Vue.config.productionTip = false
Index.myType = 'index'
const index = new Vue(Index)
index.$mount()
main.json 頁面設置導航的文字和顏色
{
"navigationBarTitleText":"index",
"navigationBarBackgroundColor":"#8ed145"
}
index.vue 頁面來咯
<template>
<div class="indexContainer">
<div class="userImg">
<open-data type="userAvatarUrl"></open-data>
</div>
<open-data type="userNickName"></open-data>
<button @tap="toHomePage">mpvue小程序</butt