1.框架
<script type="module">** **import { createApp, ref } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'** **createApp({** ** do something** **}).mount('#container')** **</script>
*必须在html标签中关联id号才能实现控制
*插值表达式{{}}
2.v-for循环
*在想要进行循环操作的标签中定义即可标签中,items为数组,item为遍历出来的元素
<tr v-for="(item,index) in items" :key="item.id> {{item}}</tr>"
3.v-if与v-show
<span v-if="条件表达式"></span>
<span v-show="条件表达式"></span>
*返回true则显示,false则隐藏,v-if先渲染后显示,v-show先显示后渲染
力扣刷题:
https://leetcode.cn/problems/shortest-path-with-alternating-colors/solutions/2086543/yan-se-jiao-ti-de-zui-duan-lu-jing-by-le-vnuu/
tips:双层图,通过01控制不同图之间的切换,维护两张图