全局组件示例
parent
2773a0eab6
commit
5027efe2f3
@ -0,0 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<view class="g_flex_column_center" style="min-height: 69px;">
|
||||||
|
<view class="btn" @click="goLogin">
|
||||||
|
空页面{{ text }}<u-tag text="雪月夜" type="success" />
|
||||||
|
<view class="g_text_c g_fs_13" style="color: #c0c4cc;" v-if="subText">{{subText}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/* 自定义空页面
|
||||||
|
*/
|
||||||
|
export default{
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
cdnBaseImg:this.G.store().cdnBaseImg
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
text:{
|
||||||
|
type:String,
|
||||||
|
default:()=>{
|
||||||
|
return "暂无数据"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
subText:{
|
||||||
|
type:String,
|
||||||
|
default:()=>{
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
goLogin(){
|
||||||
|
let that = this;
|
||||||
|
if(that.text == '请登录'){
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/login/index?path=' + that.G.getPath().path + '&level=' + that.G.getPath().level
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
@ -1,11 +1,15 @@
|
|||||||
import App from './App'
|
import App from './App'
|
||||||
import uView from './uni_modules/vk-uview-ui';
|
import uView from './uni_modules/vk-uview-ui';
|
||||||
import Vue from 'vue';
|
|
||||||
|
import gEmpty from './components/empty.vue'
|
||||||
|
|
||||||
import { createSSRApp } from 'vue'
|
import { createSSRApp } from 'vue'
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
app.use(uView)
|
app.use(uView)
|
||||||
|
|
||||||
|
app.component('g-empty', gEmpty)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue