vimesh-ui icon indicating copy to clipboard operation
vimesh-ui copied to clipboard

Puzzle

Open ericxin1982 opened this issue 1 year ago • 6 comments

image image

Hi @xinjie-zhang

Sorry to bother you, I try to create a top tree object to organize the data object for each x-data need, and I found vimesh-ui cannot read that, and vimesh-ui x-data source must be inline or created by alpine.data that way, how I can solve this?

thanks Eric Xin

ericxin1982 avatar Dec 06 '23 03:12 ericxin1982

image I changed to this way, it works. But I have another concern, the x-init would it would trigger twice.

image

Thanks Eric Xin

ericxin1982 avatar Dec 06 '23 05:12 ericxin1982

I do not use dynamic html feature, I just used static html inside.

ericxin1982 avatar Dec 06 '23 05:12 ericxin1982

image image

I tried it in a simple component, it is the same, init run twice.

Thanks Eric Xin

ericxin1982 avatar Dec 06 '23 06:12 ericxin1982

  1. please do not bind data in component definition.
<template ... x-data="put default static value here, but do not bind to external variable">..
  1. avoid to use x-init in template, you could use onMounted, please refer to examples/spa/app.html

xinjie-zhang avatar Dec 08 '23 01:12 xinjie-zhang

Excellent.

Thanks Eric Xin

ericxin1982 avatar Dec 08 '23 08:12 ericxin1982

Hi @xinjie-zhang

I have a further question, sometimes you would define x-data for component definition, sometimes you would define x-data for component instance only, what is the standard I should follow?

Thanks Eric Xin

ericxin1982 avatar Dec 10 '23 04:12 ericxin1982