or even npm.npm put in vue-bind-once-- spare.Register regulation.bring in createApp from 'vue'.bring in Application coming from './ App.vue'.bring in BindOnceDirective, BindOncePlugin coming from 'vue-bind-once'.const app = createApp( Application).app.use( BindOncePlugin).// or even app.directive(' bind-once', BindOnceDirective).Most of the times you'll be utilizing this regulation along with an SSR-rendering structure like nuxt, which might have a different way for you to register this ordinance. For example, in a Nuxt plugin:.import BindOncePlugin coming from 'vue-bind-once'.export default defineNuxtPlugin( nuxtApp => nuxtApp.vueApp.use( BindOncePlugin). ).Consumption.You may now make use of the instruction on any sort of component where you need to have a binding to a worth that needs to match in between client/server yet won't alter dynamically later on.
This will definitely work on both server as well as on client re-hydration.