1. 引入
在<script>
标签内使用import
引入 例如
import zhIcon from "@/static/zh.png";
import enIcon from "@/static/en.png";
2. 使用setup
的return
抛出到template
例如
import { reactive, toRefs } from "vue";
setup() {
const state = reactive({});
return {
...toRefs(state),
zhIcon,
enIcon
}
}
3. 在template
内部使用 例如(uni内使用image)
<image :src="zhIcon" />
一点一滴的积累让自己变得强大 奥力给
网友评论