VUE接触

awesome-Vue

Vue3.0 示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<div class="wrapper">
<p>{{ state.count }} </p>
<button @click="plus">+</button>
<button @click="minus">-</button>
<p>摄像头1 <Toggle v-model="state.value" on-label="On"
off-label="Off"/></p>
</div>
</template>

<script>

// import { ref } from 'vue';
import Toggle from '@vueform/toggle';
import { reactive } from 'vue';

const useCompute = (state) => {
const plus = () => {
state.count++;
}

const minus = () => {
state.count--;
}
return {
plus,
minus
}
}

export default {
components: {
Toggle,
},
name: 'CounterNumber',
setup () {
// let count = ref(1)
const state = reactive({
count: 0,
value: true
}),
{ plus, minus } = useCompute(state);

return {
state,
plus,
minus
}
}
}
</script>

<style src="@vueform/toggle/themes/default.css"></style>

$emit

image-20220403215636391

插件

查看3D模型

交互式动画

数字变动动画

数字变动动画2

使用 Google API 搜索地点

苹果开关样式

image-20220402180536562

模拟真实开关样式

Link

Learn Vue