-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<div class="page-container" @click="updateStem">{{ stem }}-{{ x }}-{{ y }}</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
// import { useMouse } from '@vueuse/core'; | ||
// import { ref } from 'vue'; | ||
const stem = $ref('admin'); | ||
// 公共方法里面使用$ref导出ref | ||
function useMouse() { | ||
let x = $ref(0); | ||
let y = $ref(0); | ||
// 如果直接导出x,y会被识别{x.value,y.value}这样就会使出ref响应式,使用$$()可以保持响应式相当于{x:ref(0),y:ref(0)} | ||
return $$({ | ||
x, | ||
y, | ||
}); | ||
} | ||
// 通过 | ||
const { x, y } = $(useMouse()); | ||
console.log(x); | ||
// // $ref解构方法返回的ref | ||
// const { x, y } = $(useMouse()); | ||
// console.log(x, y); | ||
const updateStem = () => { | ||
stem = 'update'; | ||
x = 200; | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
declare module '*.vue' { | ||
import { ComponentOptions } from 'vue'; | ||
const componentOptions: ComponentOptions; | ||
export default componentOptions; | ||
import { DefineComponent } from 'vue'; | ||
const Component: DefineComponent<{}, {}, any>; | ||
export default Component; | ||
} | ||
|
||
declare type Recordable<T = any> = Record<string, T>; |