diff --git a/src/sticky/README.md b/src/sticky/README.md index 8a5d11cf4..268e1f375 100644 --- a/src/sticky/README.md +++ b/src/sticky/README.md @@ -40,13 +40,9 @@ app.use(Sticky); ```js export default { - data() { - return { - container: null, - }; - }, - mounted() { - this.container = this.$refs.container; + setup() { + const container = ref(null); + return { container }; }, }; ``` diff --git a/src/sticky/README.zh-CN.md b/src/sticky/README.zh-CN.md index c75734da0..9678abe16 100644 --- a/src/sticky/README.zh-CN.md +++ b/src/sticky/README.zh-CN.md @@ -50,13 +50,9 @@ app.use(Sticky); ```js export default { - data() { - return { - container: null, - }; - }, - mounted() { - this.container = this.$refs.container; + setup() { + const container = ref(null); + return { container }; }, }; ``` diff --git a/src/sticky/demo/index.vue b/src/sticky/demo/index.vue index ba7bc0dd9..9b7c424ef 100644 --- a/src/sticky/demo/index.vue +++ b/src/sticky/demo/index.vue @@ -1,7 +1,7 @@