Files
workspace/code/g3soft-libs/docs/examples/switch/basic.vue
T
2026-10-08 22:38:34 +08:00

15 lines
408 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// 最基础用法:v-model 绑 boolean;change 回传新值与原生事件
import { ref } from 'vue'
import { G3Switch } from '@g3soft/ui'
const enabled = ref(true)
</script>
<template>
<div>
<G3Switch v-model="enabled">启用通知</G3Switch>
<p style="margin: 8px 0 0; font-size: 13px; color: #6b7280">状态:{{ enabled ? '开' : '关' }}</p>
</div>
</template>