Sleep

1 vue-bind-once - Vue.js Supplied #.\n\nA small, SSR-safe directive for binding random data to an aspect.\n\nQuick Start.\nFirst set up vue-bind-once:.\nanecdote include vue-bind-once.\n\n

or npm.npm put up vue-bind-once-- save.Sign up directive.import createApp coming from 'vue'.bring in Application coming from './ App.vue'.import BindOnceDirective, BindOncePlugin coming from 'vue-bind-once'.const app = createApp( App).app.use( BindOncePlugin).// or app.directive(' bind-once', BindOnceDirective).In most cases you'll be actually utilizing this ordinance along with an SSR-rendering structure like nuxt, which might possess a different method for you to enroll this instruction. As an example, in a Nuxt plugin:.import BindOncePlugin coming from 'vue-bind-once'.export default defineNuxtPlugin( nuxtApp =&gt nuxtApp.vueApp.use( BindOncePlugin). ).Consumption.You can easily right now utilize the directive on any sort of factor where you require a binding to a value that needs to match between client/server yet will not alter dynamically afterwards.
This will certainly work with both web server and on customer re-hydration.

Articles You Can Be Interested In