模板语法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<template>
{{msg}}
<div>{{ num ? '我是真的' : '我是假的'}}</div>
<div>{{ content.split(',').map(v=> `%${v}123`) }}</div>
<div><button @click="clickTxt">提交</button></div>
</template>

<script setup lang="ts">
const msg:string = "哈哈测试一下"
// 还可以为表达式 0为false
const num:number = 0
// 还可以跟api
const content: string = "测,试,A,P,I"

const clickTxt = () => {
console.log("触发了点击事件。")
}
</script>

<style>

</style>
1
2
3
4
5
6
7
8
9
10
setup() {
const imgs = ref();
const Codeshow = async () => {
const data = await axios.get("https://agric.lo3.cn/weather/image-code");
imgs.value = data.data.app_url;
const codeDom = document.getElementById("code");
codeDom.style.zIndex = "9999";
};
return { Codeshow, imgs };
},
1
2
3
4
5
6
import xlrd

ex = xlrd.open_workbook("1.xlsx")
table = ex.sheets()[0]
for i in range(3):
print(table.row_values(i))