我编写了这个组件(“ networkstat.vue”),它使用“ vue-network”来获取混合移动应用程序中网络的状态:
<template>
<network>
<div slot="online">
{{ content }}
</div>
<div slot="offline">
<p>You appear to be offline.</p>
</div>
</network>
</template>
<script>
import Vue from 'vue'
import Network from 'vue-network'
export default {
components: {
Network
}
}
Vue.component('networkstat', {
props: ['content']
})
</script>
我以这种方式将其用作“ vue-router”页面:
<template>
<Networkstat>
<div>Working great</div>
</Networkstat>
</template>
<script>
import Networkstat from '@/path/networkstat'
export default {
components: {
Networkstat
},
}
</script>
但是消息永远不会呈现。怎么了?
感谢您的帮助。