cone41
cone41
```vue import { onMounted, defineCustomElement, h } from 'vue'; /** * Implement the code to create a custom element. * Make the output of page show "Hello Vue.js". */ const...
```vue import { ref, watchEffect } from 'vue'; const count = ref(0); /** * Implement the until function */ function until(initial) { function toBe(value) { return new Promise((resolve, reject) =>...
```vue import { ref, nextTick } from 'vue'; const count = ref(0); const counter = ref(null); function increment() { count.value++; /** * DOM is not yet updated, how can we...
```vue A A A function onClick1() { console.log('onClick1'); } function onCtrlClick() { console.log('onCtrlClick'); } function onClick2() { console.log('onClick2'); } ```
```vue const click1 = () => { console.log('click1'); }; const click2 = () => { console.log('click2'); }; click me ```
```vue import { ref, watchEffect } from 'vue'; /** * Implement the custom directive * Make sure the list item text color changes to red when the `toggleTab` is toggled...
```vue import { ref } from 'vue'; const state = ref(false); /** * Implement the custom directive * Make sure the input element focuses/blurs when the 'state' is toggled *...
```vue import { ref } from 'vue'; const count = ref(0); setInterval(() => { count.value++; }, 1000); Make it never change: {{ count }} ```
```vue import { ref, defineModel, vModelText } from 'vue'; const value = ref(''); vModelText.beforeUpdate = (el, binding) => { if (el.value && binding.modifiers.capitalize) { el.value = el.value.charAt(0).toUpperCase() + el.value.slice(1); }...
```vue import { watch, ref, customRef } from 'vue'; /** * Implement the function */ function useDebouncedRef(value, delay = 200) { let timer = null; const customVal = customRef((track, trigger)...