feat(docs): popover code for composition (#2332)

Co-authored-by: xing.wu <wuxing@bjca.org.cn>
This commit is contained in:
Xing.Wu 2021-06-25 16:09:42 +08:00 committed by GitHub
parent 7fbe14a8ea
commit bc8db66945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 355 additions and 10 deletions

View File

@ -68,6 +68,21 @@ Similar to Tooltip, Popover is also built with `Vue-popper`. So for some duplica
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::
@ -118,6 +133,45 @@ Other components can be nested in popover. Following is an example of nested tab
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
setup() {
const state = reactive({
gridData: [
{
date: '2016-05-02',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-04',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-01',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-03',
name: 'Jack',
address: 'New York City',
},
],
});
return {
...toRefs(state),
};
},
});
</setup>
-->
``` ```
::: :::
@ -146,11 +200,26 @@ Of course, you can nest other operations. It's more light-weight than using a di
export default { export default {
data() { data() {
return { return {
visible: false, visible: false
}; };
} }
} };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::

View File

@ -68,6 +68,21 @@ Similar a un Tooltip, Popover está construido con `Vue-popper`. Así que para a
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::
@ -117,6 +132,45 @@ Otros componentes pueden anidarse dentro de popover. A continuación un ejemplo
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
setup() {
const state = reactive({
gridData: [
{
date: '2016-05-02',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-04',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-01',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-03',
name: 'Jack',
address: 'New York City',
},
],
});
return {
...toRefs(state),
};
},
});
</setup>
-->
``` ```
::: :::
@ -145,11 +199,26 @@ Por supuesto, puedes anidar otras operaciones. Es más ligero que utilizar un `d
export default { export default {
data() { data() {
return { return {
visible: false, visible: false
}; };
} }
} };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::

View File

@ -68,6 +68,21 @@ Similaire à Tooltip, Popover est aussi construit avec `Vue-popper`. Certains at
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::
@ -118,6 +133,45 @@ D'autres composants peuvent s'imbriquer dans un popover.
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
setup() {
const state = reactive({
gridData: [
{
date: '2016-05-02',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-04',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-01',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-03',
name: 'Jack',
address: 'New York City',
},
],
});
return {
...toRefs(state),
};
},
});
</setup>
-->
``` ```
::: :::
@ -146,11 +200,26 @@ Vous pouvez aussi imbriquer des opérations. Procéder ainsi est plus léger que
export default { export default {
data() { data() {
return { return {
visible: false, visible: false
}; };
} }
} };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::

View File

@ -68,6 +68,21 @@ Tooltipと同様に、Popoverも `Vue-popper` で構築されています。そ
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::
@ -118,6 +133,45 @@ popoverの中には、他のコンポーネントを入れ子にすることが
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
setup() {
const state = reactive({
gridData: [
{
date: '2016-05-02',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-04',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-01',
name: 'Jack',
address: 'New York City',
},
{
date: '2016-05-03',
name: 'Jack',
address: 'New York City',
},
],
});
return {
...toRefs(state),
};
},
});
</setup>
-->
``` ```
::: :::
@ -146,11 +200,26 @@ popoverの中には、他のコンポーネントを入れ子にすることが
export default { export default {
data() { data() {
return { return {
visible: false, visible: false
}; };
} }
} };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::

View File

@ -67,6 +67,21 @@ Popover 的属性与 Tooltip 很类似,它们都是基于`Vue-popper`开发的
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::
@ -116,6 +131,45 @@ Popover 的属性与 Tooltip 很类似,它们都是基于`Vue-popper`开发的
} }
}; };
</script> </script>
<!--
<setup>
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
setup() {
const state = reactive({
gridData: [
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
],
});
return {
...toRefs(state),
};
},
});
</setup>
-->
``` ```
::: :::
@ -144,11 +198,26 @@ Popover 的属性与 Tooltip 很类似,它们都是基于`Vue-popper`开发的
export default { export default {
data() { data() {
return { return {
visible: false, visible: false
}; };
} }
} };
</script> </script>
<!--
<setup>
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
return {
visible: ref(false),
};
},
});
</setup>
-->
``` ```
::: :::