提交 239c4383 编写于 作者: Z zhaoshuangshi

3.6、3.7章节下所有习题添加

上级 4cb41b16
{
"type": "code_options",
"author": null,
"author": "zhaoshuangshi",
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "f8fbf8fd07de47f89b4f1331ed3a7df5"
......
{
"type": "code_options",
"author": null,
"author": "zhaoshuangshi",
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "3114f486756748b3a6d351b183844cb6"
......
{
"type": "code_options",
"author": null,
"author": "zhaoshuangshi",
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "e73e42fcf8824231a41352d68cf0ee24"
......
......@@ -2,7 +2,9 @@
"node_id": "vue-c59c2a7737e041b285e2d57db6824801",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "c4bce96f523e4baf84542e8fee6155f7"
}
\ No newline at end of file
# Vue3现状
Vue3是哪天发布的?
## 答案
2020 年的 9 月 18 日
## 选项
### A
2021 年的 6 月 8 日
### B
2022 年 2 月 7 日
### C
2020 年的 12 月 18 日
......@@ -2,7 +2,9 @@
"node_id": "vue-6d10a5c3df5f46529a3e12b6b13c4e29",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "e8b998328b3049e883d6973603bf07e0"
}
\ No newline at end of file
# 构建工具Vite
Vite是一款基于什么技术实现的前端构建工具?
## 答案
Rollup
## 选项
### A
Webpack
### B
Gulp
### C
Browserify
......@@ -2,7 +2,9 @@
"node_id": "vue-f56c90e570e04ff9896d897fa6f3a7b9",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "b3d74129db7a4d14b08ab52ba70122f5"
}
\ No newline at end of file
# setup函数
在Vue 3中,setup函数返回什么?
## 答案
一个对象
## 选项
### A
一个数组
### B
一个字符串
### C
Dom元素
......@@ -2,7 +2,9 @@
"node_id": "vue-4d0274888ac942b1842228586af52671",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "032c2565f11f48abae0717ea627cdef2"
}
\ No newline at end of file
# reactive函数、ref函数
在Vue3中,以下哪些说法是关于reactive和ref函数的异同点是正确的?
## 答案
reactive函数会返回一个响应式数据对象,而ref函数会返回一个包装过的响应式数据对象,获取ref函数转化的响应式数据时可以通过.value。
## 选项
### A
reactive和ref函数都可以将JavaScript数据转换为响应式数据,没有任何区别。
### B
reactive函数可以用于对象和数组,而ref函数只能用于简单的JavaScript数据类型。
### C
ref函数可以用于对象和数组,而reactive函数只能用于简单的JavaScript数据类型。
......@@ -2,7 +2,9 @@
"node_id": "vue-f8001e5972ce4d4baf34104160ab77f7",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "5601262d8d0443558f9ebb133e8a654e"
}
\ No newline at end of file
# computed函数、watch函数
```javaScript
<template>
<div>
<input v-model="state.firstName">
<input v-model="state.lastName">
<p>{{ fullName }}</p>
</div>
</template>
<script>
import { computed, watch, reactive } from 'vue';
export default {
setup() {
const state = reactive({
firstName: '',
lastName: ''
});
const fullName = computed(() => {
return `${state.firstName} ${state.lastName}`;
});
watch(() => state.firstName, (newVal, oldVal) => {
console.log(`firstName changed from ${oldVal} to ${newVal}`);
});
watch(() => state.lastName, (newVal, oldVal) => {
console.log(`lastName changed from ${oldVal} to ${newVal}`);
});
return {
state,
fullName
};
}
};
</script>
```
观察上面代码段,如果我们在第一个输入框中输入'几何'那控制台的打印应该是?
## 答案
firstName changed from to 几何
## 选项
### A
没有输出任何内容
### B
firstName changed from null to 几何
### C
lastName changed from to <br />
firstName changed from null to 几何
{
"node_id": "vue-4695a79899a54ec794d78e22da7242df",
"keywords": [],
"children": [],
"export": [],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-168f219f9c304fd2ba987a61a1423339",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "d8bb330b4a4c4538b162af8c84ce214f"
}
\ No newline at end of file
# Vue3的生命周期函数
在Vue3中,以下哪个选项不是生命周期函数?
## 答案
beforeRender
## 选项
### A
beforeCreate
### B
beforeMount
### C
unmounted
......@@ -2,7 +2,9 @@
"node_id": "vue-f8013635f620485c88840675b2d00e7c",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "d9f20645d6554446b530296a5dcb993e"
}
\ No newline at end of file
# CSS过渡
在Vue3中,以下哪个选项是可以获取DOM和组件元素?
## 答案
通过ref声明响应式数据,通过在DOM标签上添加ref属性来绑定该该数据,即可获取DOM或者组件。
## 选项
### A
通过在DOM标签上添加ref属性值,在方法中通过this.$refs来获取。
### B
this.$emit
### C
this.$el
......@@ -2,7 +2,9 @@
"node_id": "vue-67d68f772c8245a094b9ed14745c7f86",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "7a3c6b97946647c49e121d8c999c4128"
}
\ No newline at end of file
# Vue3组件通信
在Vue3中,以下哪个选项不能用于父组件向子组件传递数据?
## 答案
$children
## 选项
### A
provide / inject
### B
props
### C
localStorage
......@@ -1525,7 +1525,7 @@
}
},
{
"reactive函数": {
"reactive函数、ref函数": {
"node_id": "vue-4d0274888ac942b1842228586af52671",
"keywords": [],
"children": [],
......@@ -1533,15 +1533,6 @@
"keywords_forbid": []
}
},
{
"ref函数": {
"node_id": "vue-4695a79899a54ec794d78e22da7242df",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": []
}
},
{
"computed函数、watch函数": {
"node_id": "vue-f8001e5972ce4d4baf34104160ab77f7",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册