vue的v-if控制显示
显示“supreme”
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue test</title>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="app">
<p v-if="aaaaaa">supreme</p>
<template v-if="ok">
<h1>swh</h1>
<p>灵魂程序员</p>
<p></p>
</template>
</div>
<script>
new Vue({
el: '#app',
data: {
aaaaaa: true,
ok: true
}
})
</script>
</body>
</html>
隐藏“supreme”
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue test</title>
<script src="https://cdn.staticfile.org/vue/2.