在Visualforce Page中使用VUE
首先引入VUE源文件,其次,如果要使用vue语法标签,一定要在html标签里面加上如:xmlns:v-model="https://cn.vuejs.org"
下面是一个完整的示例:
<apex:page cache="true" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >
<html xmlns:v-model="https://cn.vuejs.org" xmlns:v-on="https://cn.vuejs.org" xmlns:v-bind="https://cn.vuejs.org" xmlns:v-for="https://cn.vuejs.org" xmlns:v-slot="https://cn.vuejs.org" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>VUE in Visualforce Page</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
<link rel="stylesheet" type="text/css" href="https://www.jq22.com/jquery/bootstrap-3.3.4.css"/>
</head>
<body>
<div id="app">
{{Hello}}
<p><input type="text" class="form-control" v-model="Hello" /></p>
</div>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
Hello:'Hello VUE'
},
methods : {
}
});
</script>
</body>
</html>
</apex:page>