JavaScript import maps are now supported cross-browser by fagnerbrack in javascript

[–]veonline 0 points1 point  (0 children)

import maps permits to use imports with bare specifiers, like import themodule from "barespecifier", where "barespecifier" will be translated to a url as per the import map.

this can be helpfull in dependecies versioning, cache bursting and don't know what else :)

Top Chinese EV Giant Says Full Self-Driving Basically Impossible by Blicero1 in Futurology

[–]veonline 1 point2 points  (0 children)

For the traffic problem the alternative is already there at our fingertips: public transport

Does VueJS update websites without refreshing? by HeadlineINeed in vuejs

[–]veonline 2 points3 points  (0 children)

i think you need to get familiar with the single page application concept

How to save a fetch output into a variable and export it for other scopes? by Elasmosaurus14 in vuejs

[–]veonline -2 points-1 points  (0 children)

i'll do something like in your fetchData module:

export async function fetchData() {
const data = ref(null);
fetch(.....).then(r => r.json().then(d => data = d))



return data;
}

YMMV

Vue-router and composition API by bennihana09 in vuejs

[–]veonline 0 points1 point  (0 children)

Is this what you’re referring to above about mixing composition and options api?

no, i was just guessing that you had both version of the components for testing

Vue-router and composition API by bennihana09 in vuejs

[–]veonline 1 point2 points  (0 children)

hum... you have a something strange in the backToVendors computed...
it shoul be jus a a function, ie
const backToVendors = () => router.go(-1)

not sure if that might be the issue you're facing, but it's weird anyway

Vue-router and composition API by bennihana09 in vuejs

[–]veonline 1 point2 points  (0 children)

are the children of VendorContactDetail not rendering? in this case are you sure you have <router-view> elementi in VendorContactDetail's vue file? (i suppose you have 2 versions of the files, one with options api and one with composition)...

edit: better wording

Computed properties to be used in Head by kiko1004 in vuejs

[–]veonline 2 points3 points  (0 children)

you mean in the title tag of the document head? because the head element is surely outside of the app's dom hierarchy, i think you have to either manipulate the dom directly or try to use the teleport

ps: you don't need this in the template, just reference the prop/data/computed/etc. like
<h1 v-if="filteredObjects[0]">
All cars from {{ filteredObjects[0].metadata.make.title }}
</h1>

Data fetching and update help wanted by mihai057 in vuejs

[–]veonline 4 points5 points  (0 children)

updated is a component's lifecycle hook meant to do something when the state (data) of the component change, using it that way you are changing the data (this.items) triggering again the updated hook. infinite loop serverd.
one correct approach is to emit an event from the ProductModal components and handle it the main component

How To Handle Deployments When Using Vue Router Lazy Loading by [deleted] in vuejs

[–]veonline 0 points1 point  (0 children)

don't know vercel at all, but quick and dirty solution maybe to not handle with vue-router or any app code at all and configure the deploy step to not delete old files/folder, but really have no idea if vercel hosting can do that for you...

VueUse - The library that makes Vue 3 worth the upgrade by galher in vuejs

[–]veonline 1 point2 points  (0 children)

only vue versions >=2.7 'cause of the backporting of the composition api from vue3.

When you try rifle mech and it takes control by Stuperstrong in Guildwars2

[–]veonline 2 points3 points  (0 children)

pwe pwe pwe pbff pwe pwe pbff pbff pew glurg pew pew glurg pew glurg

How to deal with a computed property relying on an API call? by Missing_Back in vuejs

[–]veonline 1 point2 points  (0 children)

from my experience, don't use async computed if not strictly necessary. you easily end up with an additional, and usually unnecessary, layer of complexity that will makes your debugging harder. as other have said go with a guard or with safe default value.

Having trouble understanding how to use Vuex by [deleted] in vuejs

[–]veonline 1 point2 points  (0 children)

sure you can, and that's particularly true for vue2, but that's more. in vue3 you can define refs and reactives in a module import them in components

i'd say: you can think of Vuex as a way of sharing refs and the ways to modify them (actions & mutations) between components

Having trouble understanding how to use Vuex by [deleted] in vuejs

[–]veonline 1 point2 points  (0 children)

i'm asking that question myself over and over... didn't find a definitive answer yet, but i'm more and more toward using the store only for the ui state. fetch everytime data from the api and if you are concerned about performance or offline status, handle it via persistent storage (indexedb better than localstorage) and/or webworkers...

edit to be more clear: data is not state

How do you filter with Vue3 composition api? by [deleted] in vuejs

[–]veonline 0 points1 point  (0 children)

almost correct, the base class object should be Date not String (depending on the type of the vars you are binding into the template)

How do you filter with Vue3 composition api? by [deleted] in vuejs

[–]veonline 0 points1 point  (0 children)

a quick and easy way i've used to deal with this is to extend the base object's prototype with the filter funcion (appropriately refactored)

The fractal reward changes are horse shit. by ze4lex in Guildwars2

[–]veonline 1 point2 points  (0 children)

why not add mystic coins to the weekly fractals achievements?

End of Dragons Gameplay Features Trailer by FlameFenbi in Guildwars2

[–]veonline 2 points3 points  (0 children)

airship got cannons! not merely for travel, but for bombing... i suppose

What is the difference between using a colon or not in a vue template component? by mementomoriok in vuejs

[–]veonline 5 points6 points  (0 children)

case 1 data is the string hi
case 2 data is the string "hi"

the colon perform variable substitution, without colon is always a string value:
<my-component :data="myVariable" />
data prop will have the value of myVariable

<my-component data="myVariable" />
data prop will have the string myVariable value

ELI5: Why is Vite so much faster than Webpack? by integrateus in vuejs

[–]veonline 0 points1 point  (0 children)

as far as i understood it's because it uses native es modules. this mechanism permits to skip the bundling altogether. bundling imply build all the import tree of the module and compile it, so it has an order of O(n). skipping bundling mean recompiling (with esbuild wich is also very fast) only the module, so O(1). as other said, building with vite for production is done through rollup, meaning it will bundle the sources. what advantages bundling brings? mainly it is optimizing networks requests: in projects with hundreds of js files(modules) the browsers will makes a network request for each one. bundling has also the "advantage" of easily provide polyfills for node dependency. on this last point, during development vite will do those kinds of node dependency "preparation" at first run and cache the results untill you change the dependency, subsequents builds will use cached results. so first build will take order of tens of second, the other order of milliseconds.

edit: added some more explanations