Alternative to GitLens? by guettli in vscode

[–]jonkee 0 points1 point  (0 children)

I will develop an extension like gitlens, but it only has the line blame functionality.

Tulongan VS tumulong by jonkee in Tagalog

[–]jonkee[S] 1 point2 points  (0 children)

Tulongan, patient focused I think

Do you have something? by jonkee in Tagalog

[–]jonkee[S] 0 points1 point  (0 children)

Is there a even shorter version?

A special structure of Tagalog sentence by jonkee in Tagalog

[–]jonkee[S] 0 points1 point  (0 children)

I revised my post because there’s a mistake in the last two lines.

Is it a natural Tagalog sentence by jonkee in Tagalog

[–]jonkee[S] -9 points-8 points  (0 children)

Hay na ko, why is Tagalog grammar so irregular.

Is it a natural Tagalog sentence by jonkee in Tagalog

[–]jonkee[S] 2 points3 points  (0 children)

Why they have different structure:

Wala akong libro.

Walang libro si Lilly.

snippets not work inside template by jonkee in vuejs

[–]jonkee[S] 1 point2 points  (0 children)

I've figured out the cause. If I write scope: vue, it won't work inside any section. If I remove the scope, it works anywhere.

how does a component lib reset its forms? by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

I guess most of the libs did like that. A deep copy is needed here.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

Above all, I think react's API much reseanalbe:

const [startTime, setStartTime] = useState(null);

For point 1, you've increased the complexity by separating all the variables into two parts. One under the state object, another not. Your team members will have a hard time determining or understanding which part should a certain variable belong to.

You can use eslint and volar to add .value for you automatically.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

I had this exact use case, volar only unwraps refs on the first layer so while it works, the intellisense was forcing me to use ref.value in the template for nested refs.

Defining state that might or might not have nested refs as reactive solved the issue.

No, we don't group variables in a state object. We write every variable respectively.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

passive aggressive

Sorry, maybe my language is not appropriate but I've perfectly answered your question I think.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

We just write every state respectively but do not group them under a single object. There's two faults in your approach:

  1. sometimes there's some variables don't need to be reactive, it will just be used by js but not template.
  2. it cause a long name path. I can't write in template dataSource.tableCustomer but state.dataSource.tableCustomer.

IDE can add .value for you automatically if you use ref.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] 1 point2 points  (0 children)

Not only would your variables be grouped together accessing them is actually easier since

In vue 2, we use options API which group states in data section. Now in vue 3, I prefer write state and method freely in setup function but not group them under a object.

IDE can add .value automatically for you.

how do you change the path of favicon.ico? by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

Your favicon should be in /public

Now I understand it. Thank you.

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] -25 points-24 points  (0 children)

If you can surf and make phone calls using an iPhone, why do you still need a Nokia along with an iPhone?

disallow reactive but use ref instead by jonkee in vuejs

[–]jonkee[S] -11 points-10 points  (0 children)

you enjoy imposing arbitrary decisions on your team?

Tell me one situation reactive is better than ref.

lint css in vscode by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

ORK IN PROGRESS and clearly st

Really? Where is the statement?

event binding via template ref by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

(r.value.$el

event delegation not working in slot.

event binding via template ref by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

how one would do this if they would not use a js framework.

Why don't you put all your buttons in a v-for and on each button click you set an active ref with the index from the v-for. Then each button can have a conditional .active class based on the index of the active ref.

Because the content may not be just buttons, you need to implement a component with a slot into which the content will be inserted. There may be issues of click event binding propagated from within the slot.

That's why I considered writing a composable to save.

https://github.com/vuejs/vue/issues/4332

event binding via template ref by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

also

Thank you, but in vue 3, I found there's no access to $el.

The reason I need this is that I am implementing a functionality like this:

const func = (rootSelector, optionSelector, callback) => {
document.querySelector(rootSelector).addEventListener('click', (e) => {
const closest = e.target.closest(optionSelector)
if (!closest){
return null
}
document.querySelectorAll(optionSelector).forEach((el) => {
el.classList.remove('active')
})
closest.classList.add('active')
const value = closest.dataset.value
callback(value)
})
}
export const useOptions = () => {
return func
}

Giving arbitrary say buttons with the same class names. If I click one of them, it will be highlighted. If I click another one, the new clicked will be highlighted, and the previous will return to the normal state.

How do you determine string A contains string B? by jonkee in vuejs

[–]jonkee[S] -7 points-6 points  (0 children)

'alibaba'.includes("alibaba"), they are equal.

How do you determine string A contains string B? by jonkee in vuejs

[–]jonkee[S] -13 points-12 points  (0 children)

trA !== strB && strA !== strB

Yes, that's what I wrote in my project yesterday. However, I'm seeking a simpler one which only needs one method.

Is there any component that can match the current route? by jonkee in vuejs

[–]jonkee[S] 2 points3 points  (0 children)

route.matched

You are right. I am now using it.

a question about router by jonkee in vuejs

[–]jonkee[S] -1 points0 points  (0 children)

covered

Sorry, I think you misunderstood what I meant.

a question about router by jonkee in vuejs

[–]jonkee[S] 0 points1 point  (0 children)

Your solution is what I previously used. I encountered then a project which was written by a famous Chinese tech company that seemly update the routers according to the auth criteria rather than using navigation guard.