mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:38:18 -04:00 
			
		
		
		
	* fix typing on auth context * extract user password strength meter * fix broken useToggle method * extend form to accept arguments for validators * enforce password length on update * fix user password change form
		
			
				
	
	
		
			40 lines
		
	
	
		
			692 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			692 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <component :is="tag">
 | |
|     <slot name="activator" v-bind="{ toggle, state }"> </slot>
 | |
|     <slot v-bind="{ state, toggle }"></slot>
 | |
|   </component>
 | |
| </template>
 | |
| 
 | |
| <script lang="ts">
 | |
| import { defineComponent, ref, watch } from "@nuxtjs/composition-api";
 | |
| 
 | |
| export default defineComponent({
 | |
|   props: {
 | |
|     value: {
 | |
|       type: Boolean,
 | |
|       default: false,
 | |
|     },
 | |
|     tag: {
 | |
|       type: String,
 | |
|       default: "div",
 | |
|     },
 | |
|   },
 | |
|   setup(_, context) {
 | |
|     const state = ref(false);
 | |
| 
 | |
|     const toggle = () => {
 | |
|       state.value = !state.value;
 | |
|     };
 | |
| 
 | |
|     watch(state, () => {
 | |
|       context.emit("input", state);
 | |
|     });
 | |
| 
 | |
|     return {
 | |
|       state,
 | |
|       toggle,
 | |
|     };
 | |
|   },
 | |
| });
 | |
| </script>
 |