cty.js 文件
export default[
({ id: "+86", name: "中国 +86" },
{ id: "+1", name: "美国 +1" },
{ id: "+81", name: "日本 +81" },]
在html文件引入并使用
<script type="module">
import cty from './api/cty.js'
var vm = new Vue({
el: "#register",
data: {
cty:cty,
pcode:""
},)}
</script>
如果不能正常使用,可将cty.js改成
export let cty = [
{ id: "+86", name: "中国 +86" },
{ id: "+1", name: "美国 +1" },
{ id: "+81", name: "日本 +81" },]
在html文件引入并使用
<script type="module">
import {cty} from './api/cty.js'
var vm = new Vue({
el: "#register",
data: {
cty:cty,
pcode:""
},)}
</script>
网友评论