You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
538 B
22 lines
538 B
<template>
|
|
<h2>{{title}}</h2>
|
|
</template>
|
|
<script>
|
|
({
|
|
data: function(){
|
|
return {
|
|
title: '首页',
|
|
token:null
|
|
}
|
|
},
|
|
mounted: function () {
|
|
document.querySelector('title').innerHTML = this.title;
|
|
this.token = PubSub.subscribe('msg', function (msg, data) {
|
|
alert(msg + data);
|
|
});
|
|
},
|
|
beforeDestroy: function () {
|
|
PubSub.unsubscribe(this.token);
|
|
}
|
|
});
|
|
</script> |