通过cdn引入vue开发_vue-router通过CDN的方式引入怎么使用啊

<!DOCTYPE html>

<html lang="zh-cn">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content=" width=device-width,user-scalable=no">

<meta content="telephone=no,address=no,email=no" name="format-detection">

<title>vue</title>

<meta name="keywords" content="" />

<meta name="description" content=""/>

<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>

<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>

<script type=text/javascript>

(function(win) {

var doc = win.document;

var docEl = doc.documentElement;

var tid;

function refreshRem() {

var width = docEl.getBoundingClientRect().width;

if (width > 750) {

width = 750;

var rem = width / 7.5;

docEl.style.fontSize = rem + 'px';

win.addEventListener('resize', function() {

clearTimeout(tid);

tid = setTimeout(refreshRem, 300);

}, false);

win.addEventListener('pageshow', function(e) {

if (e.persisted) {

clearTimeout(tid);

tid = setTimeout(refreshRem, 300);

}, false);

refreshRem();

})(window);

</script>

</head>

<body>

<div id="app">

<p>{{ message }}</p>

<a @click="move" v-if="isLogin">点击</a>

<router-link to="/home">Go to Foo</router-link>

</div>

<script>

new Vue({

el: '#app',

data: {

message: 'Hello Vue.js!',

isLogin:false

methods:{

move(){

console.log('ddd')

</script>

</body>

</html>

原文链接:https://blog.csdn.net/weixin_32479557/article/details/114049880?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165918321816781685319381%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165918321816781685319381&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-25-114049880-null-null.nonecase&utm_term=cdn

原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/193

(0)
上一篇 2022年8月4日 07:42
下一篇 2022年8月4日 07:57

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

优速盾注册领取大礼包www.cdnb.net
/sitemap.xml