需求:修改框中的信息

一、在main.js中:
1 2 3 4 5 6 7 |
// 设置浏览器标题 Vue.directive('title', { inserted: function (el, binding) { document.title = el.dataset.title } }) |
二、在某个页面最大的div上:

加上以下代码:
1 |
v-title data-title="测试title" |
效果:

最简洁方法:

未经允许不得转载:一点博客-青梅煮码-共享博客 » 动态修改Vue项目中的页面title
评论抢沙发