rocks

Results 19 issues of rocks

```vue // 你的答案 ``` ` import { onMounted, inject, onBeforeUnmount } from "vue" import type {Ref} from 'vue' const timer:any = inject("timer") const count :Ref= inject("count") onMounted(() => { timer.value...

answer
zh-CN

```vue // 你的答案 ``` import { onBeforeUnmount, onMounted, ref } from 'vue'; // Implement ... function useEventListener(target, event, callback) { onMounted(()=>{ target.addEventListener(event,callback) }) onBeforeUnmount(()=>{ target.removeEventListener(event) }) } // Implement ......

answer
zh-CN

```vue // 你的答案 ``` import { ref } from 'vue'; interface UseCounterOptions { min?: number max?: number } /** * Implement the composable function * Make sure the function works...

answer
zh-CN

import { ref } from 'vue'; /** * Implement a composable function that toggles the state * Make the function work correctly */ function useToggle(bol:boolean) { const state=ref(bol) const toggle=()=>{...

answer
zh-CN

```vue // 你的答案 ``` interface TreeData { key: string title: string children: TreeData[] } const {data} = defineProps() console.log(data,'@') {{item.title}} .mr{ margin-left:10px; }

answer
zh-CN

```vue // 你的答案 ``` import { defineComponent,h } from "vue" export default defineComponent({ name: 'MyButton', render({$attrs,$emit,$slots}) { return h('button',{ props:{ ...$attrs }, onClick:()=> $emit('custom-click') },$slots) } })

answer
zh-CN

```vue // 你的答案 ``` :global(body) { width: 100vw; height: 100vh; background-color: burlywood; }

answer
zh-CN

```vue // 你的答案 ``` v-bind(theme)

answer
zh-CN

```vue // 你的答案 ``` v-once 或者 v-memo="[]"

answer
zh-CN