相关疑难解决方法(0)

如何在vuejs中绑定html <title>内容?

我正在尝试关于vuejs的演示.现在我希望html标题绑定一个vm字段.

以下是我试过的:

index.html

<!DOCTYPE html>
<html id="html">
<head>
    <title>{{ hello }}</title>
    <script src="lib/requirejs/require.min.js" data-main="app"></script>
</head>
<body>
{{ hello }}
<input v-model="hello" title="hello" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

app.js

define([
    'jquery', 'vue'
], function ($, Vue) {
    var vm = new Vue({
        el: 'html',
        data: {
            hello: 'Hello world'
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

但标题似乎没有限制,如何使它工作?

html javascript frontend mvvm vue.js

46
推荐指数
3
解决办法
4万
查看次数

标签 统计

frontend ×1

html ×1

javascript ×1

mvvm ×1

vue.js ×1