|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="demo">
|
|
|
<h2>基础用法</h2>
|
|
|
- <nut-cell :showIcon="true" :isLink="true" @click="notify1('通知内容')">
|
|
|
+ <nut-cell :showIcon="true" :isLink="true" @click="notify1('isVisible1')">
|
|
|
<span>
|
|
|
<label>基础用法</label>
|
|
|
</span>
|
|
|
@@ -10,17 +10,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { createApp } from 'vue';
|
|
|
+import { reactive, createApp } from 'vue';
|
|
|
import { createComponent } from '@/utils/create';
|
|
|
-import notify from './index';
|
|
|
+// import notify from './index';
|
|
|
const { createDemo } = createComponent('notify');
|
|
|
-const app = createApp({});
|
|
|
-app.use(notify);
|
|
|
+// const app = createApp({});
|
|
|
+// app.use(notify);
|
|
|
export default createDemo({
|
|
|
- props: {},
|
|
|
setup() {
|
|
|
- const notify1 = () => {
|
|
|
- notify('content');
|
|
|
+ const state = reactive({
|
|
|
+ isVisible1: false,
|
|
|
+ isVisible2: false,
|
|
|
+ isVisible3: false,
|
|
|
+ isVisible4: false,
|
|
|
+ isVisible5: false
|
|
|
+ });
|
|
|
+ const notify1 = param => {
|
|
|
+ state[`${param}`] = !state[`${param}`];
|
|
|
};
|
|
|
return {
|
|
|
notify1
|