owner stringclasses 14
values | repo stringclasses 14
values | id int64 116k 4.61B | issue_number int32 1 181k | author stringlengths 1 39 | body stringlengths 1 262k | created_at timestamp[us]date 2000-06-06 02:40:44 2026-06-02 20:16:18 | updated_at timestamp[us]date 2000-06-06 02:40:44 2026-06-02 20:22:56 | reactions unknown | author_association stringclasses 5
values |
|---|---|---|---|---|---|---|---|---|---|
vuejs | core | 651,802,318 | 1,465 | yyx990803 | Provide/inject is only for managing DI between components inside a component tree. Dependencies between plugins is out of scope for this API. | 2020-06-30T13:48:08 | 2020-06-30T13:48:08 | {} | MEMBER |
vuejs | core | 652,609,897 | 1,481 | yyx990803 | This is actually unnecessary. It's ok to trigger multiple times when it's sync. | 2020-07-01T19:39:47 | 2020-07-01T19:39:47 | {} | MEMBER |
vuejs | core | 653,832,590 | 1,033 | wonderful-panda | FYI, namespace `JSX` can be renamed to avoid conflict (for example, `VueJSX` ).
And TypeScript uses `VueJSX` instead of `JSX` by putting this configuration into `tsconfig.json` .
```tsconfig.json
"jsxFactory": "VueJSX"
``` | 2020-07-05T02:10:08 | 2020-07-05T02:10:08 | {
"-1": 3,
"eyes": 1
} | CONTRIBUTOR |
vuejs | core | 650,241,908 | 1,359 | yyx990803 | This is technically doable:
1. We use `@babel/parser` to parse inline expressions, which already comes with TypeScript support for free. I tested by adding `typescript` to the parser plugin list and your example compiles just fine.
2. We need to add a pass to strip type annotations, which can be done with `esbuil... | 2020-06-26T15:29:00 | 2020-06-26T15:29:00 | {
"+1": 31,
"heart": 8
} | MEMBER |
vuejs | core | 650,640,704 | 1,454 | yyx990803 | This is expected behavior in Vue 3. `maxlength` is an attribute, `maxLength` is a DOM property. They are *not* the same.
Technically using `maxLength` in Vue 2 without the .prop modifier is wrong. Vue 3 detects DOM properties and sets them as properties if they exist on the element. | 2020-06-27T22:26:33 | 2020-06-27T22:26:33 | {} | MEMBER |
vuejs | core | 651,854,245 | 1,472 | underfin | =.= I'm curious about why use `_` flag make marker compilered slots.Why not add a new `static_slots` patchFlags instead of it(we has already `dynamic_slots` flag and them can represent all compiled case)?
The compiled code is clear and we don't nedd process edge case. | 2020-06-30T15:06:52 | 2020-06-30T15:08:31 | {} | MEMBER |
vuejs | core | 652,173,771 | 1,359 | limingzhiguang | I think use computed or methods | 2020-07-01T03:54:29 | 2020-07-01T03:54:29 | {} | NONE |
vuejs | core | 653,002,250 | 1,491 | yyx990803 | I'm not sure about this. To me `ReturnType<typeof readonly>` is more semantically correct than `Readonly<UnwrapNestedRefs<SomeInterface>>`. The latter is implementation details, and if the type of `readonly` changes in the future, you risk having incompatible types. | 2020-07-02T13:21:44 | 2020-07-02T13:21:44 | {
"+1": 1
} | MEMBER |
vuejs | core | 653,441,660 | 1,246 | guaijie | the above problems have not been resolved | 2020-07-03T09:10:26 | 2020-07-03T09:10:26 | {} | CONTRIBUTOR |
vuejs | core | 653,606,248 | 1,227 | yyx990803 | You already can use explicit `$data` and `$props` in templates, it's just the overhead of getting them off the `_ctx` proxy that needs to be removed.
Note that I'm not against the overall idea at all. It's something we will definitely implement.
What I think we should do:
1. Add `$setup` for direct access to ... | 2020-07-03T15:55:52 | 2020-07-03T16:04:03 | {
"+1": 2,
"heart": 1,
"rocket": 3
} | MEMBER |
vuejs | core | 654,454,363 | 1,507 | yyx990803 | Template ref setting should be treated as a post render effect. I think it's better to not rely on reactivity internals for this. See 36b6b4f0 | 2020-07-06T20:40:50 | 2020-07-06T20:40:50 | {} | MEMBER |
vuejs | core | 650,783,835 | 1,438 | zhangenming |

now i get a hack very useful
like `:justAHack="(SUDUKO = gene([S, I]), '')"` | 2020-06-28T15:46:33 | 2020-06-29T02:48:26 | {} | CONTRIBUTOR |
vuejs | core | 651,877,357 | 1,472 | yyx990803 | Because `_` already exists and is writable, the new defined property will also be writable.
The reason we don't use a vnode flag is because the slots object may get passed down in a render function. If we only check the vnode's flag, then it is treated as manual/dynamic once passed down. But if we keep the informati... | 2020-06-30T15:42:58 | 2020-06-30T15:42:58 | {
"+1": 1
} | MEMBER |
vuejs | core | 652,261,556 | 1,475 | jacekkarczmarczyk | Or
```
<template>
// default
</template>
<template fallback>
// fallback
</template>
```
I guess it should go via RFC process | 2020-07-01T08:03:38 | 2020-07-01T08:03:38 | {} | CONTRIBUTOR |
vuejs | core | 652,621,351 | 1,473 | yyx990803 | Umm this is obviously not gonna work? `vue-d3-network` is not Vue 3 compatible. It distributes `*.vue` files compiled with Vue 2's SFC compiler. | 2020-07-01T20:07:25 | 2020-07-01T20:08:04 | {} | MEMBER |
vuejs | core | 654,907,906 | 1,538 | yyx990803 | Devtool is not ready for Vue 3 yet: https://github.com/vuejs/vue-next#other-projects
We are working on it though and should have a Vue 3 compatible version soon. | 2020-07-07T14:36:02 | 2020-07-07T14:36:02 | {
"+1": 3
} | MEMBER |
vuejs | core | 651,827,170 | 1,472 | underfin | There places maybe should prevent assign new '_' enumberable flag because it is readonly.
https://github.com/vuejs/vue-next/blob/062835d45aaf4168ddf2e39a5c7e162b3a18ccae/packages/runtime-core/src/componentSlots.ts#L133-L145 | 2020-06-30T14:25:44 | 2020-06-30T14:25:44 | {} | MEMBER |
vuejs | core | 653,894,512 | 1,512 | HcySunYang | #1508 | 2020-07-05T14:17:56 | 2020-07-05T14:17:56 | {} | MEMBER |
vuejs | core | 654,545,099 | 1,512 | yyx990803 | Thanks for the PR, but it can be simpler by just using `renderVNode` directly: 41db49df | 2020-07-07T01:26:29 | 2020-07-07T01:26:29 | {
"+1": 1
} | MEMBER |
vuejs | core | 654,704,469 | 1,532 | posva | I think some mechanism for this would be useful for Vuex as well | 2020-07-07T08:56:31 | 2020-07-07T08:56:31 | {
"+1": 2
} | MEMBER |
vuejs | core | 650,232,339 | 1,314 | yyx990803 | This seems to have been resolved by #1197 | 2020-06-26T15:11:20 | 2020-06-26T15:11:20 | {} | MEMBER |
vuejs | core | 653,439,287 | 1,494 | HcySunYang | Just use the `PropType`, and remove type annotation on `setup(props: Props)`:
```ts
export default defineComponent({
name: 'TodoItem',
props: {
todo: {
type: Object as PropType<TodoItem>,
required: true
}
},
setup(props) {
console.log(JSON.stringify(props, null, 2))
con... | 2020-07-03T09:05:10 | 2020-07-03T09:05:10 | {
"+1": 4
} | MEMBER |
vuejs | core | 653,735,468 | 1,489 | LongTengDao | In fact, I think Proxy solution for Map/Set things is unnecessary, and more expensive, not like for Object/Array.
Maybe we can just import an Map/Set class from Vue, which has reactive methods pre defined, and use that to new/extends. Map/Set things do not have literal style from the begining (not like Object/Array)... | 2020-07-04T07:52:49 | 2020-07-04T08:01:45 | {} | CONTRIBUTOR |
vuejs | core | 653,749,797 | 1,489 | axetroy | Use custom Map/Set which is not standard
```ts
import ReactiveMap "@vue/map"
import ReactiveSet "@vue/set"
new ReactiveMap() // not new Map()
new ReactiveSet(); // not new Set()
```
Compromising to standards for performance, I think it’s not good
Maybe the performance of proxy Map/Set is not good, But t... | 2020-07-04T10:38:06 | 2020-07-04T10:38:29 | {} | NONE |
vuejs | core | 654,064,208 | 1,520 | xrkffgg | This is my environment.
- Input method: Sogou
- System: Mac

| 2020-07-06T07:26:46 | 2020-07-06T07:31:19 | {} | NONE |
vuejs | core | 651,072,561 | 1,461 | CyberAP | This won't work either. The value should be the first character.
I've made a correctly working example on Svelte: https://svelte.dev/repl/13ac02395cb24725bf445f4f19e0d1e2?version=3.23.2 | 2020-06-29T12:04:09 | 2020-06-29T12:04:09 | {} | CONTRIBUTOR |
vuejs | core | 651,873,747 | 1,460 | mariusa | Unrelated: @sdras , where can one find the migration guide to vue v3, please? I've read you're working on it, but no link posted anywhere. I'd like to migrate a vue2 project. Thanks! | 2020-06-30T15:37:24 | 2020-06-30T15:37:24 | {} | NONE |
vuejs | core | 651,873,987 | 1,461 | CyberAP | Thanks for improving that! Yet that doesn't solve my issue unfortunately. With that approach I would have to call next tick on every wrapper component that does carry the actual state, which I am trying to avoid. Or create a watcher for modelValue, which also doesn't improve the situation. You were right in saying that... | 2020-06-30T15:37:46 | 2020-06-30T15:37:46 | {} | CONTRIBUTOR |
vuejs | core | 652,706,721 | 1,474 | yyx990803 | I don't think we should support `Object.prototype` properties but we should also warn it properly. see f3e9c1b5 | 2020-07-02T00:13:47 | 2020-07-02T00:13:47 | {} | MEMBER |
vuejs | core | 654,432,878 | 1,503 | yyx990803 | I took another look and this is because you are building it locally with linked Vue in the dependency tree, so webpack resolves `vue` for `vue3lib` based on its location. This will not happen in production if you list `vue` in `vue3lib` as a peer dep. The solution for your local development is what @HcySunYang suggeste... | 2020-07-06T19:50:37 | 2020-07-06T19:51:09 | {
"+1": 3
} | MEMBER |
vuejs | core | 651,272,701 | 1,461 | yyx990803 | Btw - the Svelte example works that way because `$:` is like a watcher - it's essentially running another update right after the first `name` invalidation.
If you write it in Vue with the exact equivalent using `watchEffect` it works as expected:
```js
import { createApp, ref, watchEffect } from 'vue'
export ... | 2020-06-29T17:59:10 | 2020-06-29T17:59:33 | {} | MEMBER |
vuejs | core | 651,278,829 | 1,461 | CyberAP | Thanks for your input!
> Btw - the Svelte example works that way because $: is like a watcher - it's essentially running another update right after the first name invalidation.
That's true, I chose this way because it's conceptually closer to how it should be done in Svelte.
Computed model similar to one in Vue ... | 2020-06-29T18:12:31 | 2020-06-29T18:12:31 | {} | CONTRIBUTOR |
vuejs | core | 651,392,879 | 1,463 | shengxinjing | thanks for review | 2020-06-29T22:01:22 | 2020-06-29T22:01:22 | {} | CONTRIBUTOR |
vuejs | core | 652,617,904 | 1,482 | yyx990803 | ```js
const xx = {
innerHTML: this.val
}
```
Should not be hoisted out of a compiled slot, since it makes `this.val` a dependency of the parent instead of the slot. A compiled slot must capture **all** the dependencies it relies on.
In the template compiler, a slot that references external variables are de-... | 2020-07-01T19:59:04 | 2020-07-01T20:00:57 | {} | MEMBER |
vuejs | core | 653,929,143 | 1,513 | yyx990803 | `NaN === NaN // false`
Make sure to never use `NaN` as a key. | 2020-07-05T19:30:00 | 2020-07-05T19:30:00 | {} | MEMBER |
vuejs | core | 653,930,089 | 1,503 | yyx990803 | `vue3lib` shouldn't have `vue` listed as a dependency if `vue` is externalized - it should be a peer dependency. | 2020-07-05T19:39:42 | 2020-07-05T19:39:52 | {
"hooray": 1
} | MEMBER |
vuejs | core | 654,547,378 | 1,521 | yyx990803 | The watcher is triggered during the update of the child component itself and queued after. You can use a sync watcher:
```js
watch: {
value: {
handler(val) {
console.log('watch value change')
this.stateValue = val;
},
flush: 'sync'
}
}
```
Or, even better, u... | 2020-07-07T01:35:24 | 2020-07-07T01:35:24 | {} | MEMBER |
vuejs | core | 654,559,628 | 1,462 | Picknight | Sure. | 2020-07-07T02:23:19 | 2020-07-07T02:23:19 | {} | CONTRIBUTOR |
vuejs | core | 654,777,721 | 1,534 | liulinboyi | @AshwinTayson You can use this:
https://github.com/ChrisShank/vue-next-webpack-preview | 2020-07-07T11:06:02 | 2020-07-07T11:06:02 | {} | MEMBER |
vuejs | core | 675,558,294 | 1,680 | yyx990803 | Closed in favor of https://github.com/vuejs/vue-next/pull/1627
It's better to just keep it consistent with runtime behavior. | 2020-08-18T15:46:09 | 2020-08-18T15:46:09 | {} | MEMBER |
vuejs | core | 676,209,485 | 1,891 | HcySunYang | This will be fixed in the next release. | 2020-08-19T11:44:34 | 2020-08-19T11:44:34 | {} | MEMBER |
vuejs | core | 676,332,784 | 1,891 | HcySunYang | @pikax Aha, I just saw that you have submitted a PR for this issue, but our approach is different. | 2020-08-19T13:11:35 | 2020-08-19T13:11:35 | {} | MEMBER |
vuejs | core | 676,391,813 | 1,889 | yyx990803 | It should not return here. `exhaustiveCheck` is a type-only check. | 2020-08-19T13:50:51 | 2020-08-19T13:50:51 | {} | MEMBER |
vuejs | core | 676,672,498 | 1,896 | yyx990803 | This looks to make slightly more sense than #1898 but honestly both are kinda magic 😅 | 2020-08-19T20:36:17 | 2020-08-19T20:36:17 | {} | MEMBER |
vuejs | core | 676,684,188 | 1,900 | basvanmeurs | The original implementation creates new get and set functions on every individual ref. This explains the higher memory consumption when creating a lot of them. The optimizer is also less able to optimize it, as they are different functions. | 2020-08-19T20:45:53 | 2020-08-19T20:45:53 | {} | CONTRIBUTOR |
vuejs | core | 676,726,394 | 1,890 | yyx990803 | What's the use case for this? I mean an actual end user interaction that you are trying to build.
The `@change` event for `vue-portals` is emitted when portal content changes, which doesn't seem to be what you are asking for here. | 2020-08-19T21:37:40 | 2020-08-19T21:38:50 | {} | MEMBER |
vuejs | core | 677,242,903 | 1,901 | clmystes | A test case failed in CI, but was successful on the local machine, I will try to find out why. | 2020-08-20T06:07:03 | 2020-08-20T06:07:03 | {} | CONTRIBUTOR |
vuejs | core | 677,710,051 | 1,905 | yyx990803 | We can simply check if the new vnode already has `el` (since dynamic children are already patched). It would be more efficient than a `includes` check on every child. See d4cc7b24 | 2020-08-20T14:45:18 | 2020-08-20T14:45:18 | {} | MEMBER |
vuejs | core | 677,783,261 | 1,906 | ivanheral | @yyx990803,
Here you have a link with the example of the problem. I have to replace rc6 with the fix to see html correctly.
https://github.com/ivanheral/vue3_fix | 2020-08-20T16:56:47 | 2020-08-20T16:56:47 | {} | NONE |
vuejs | core | 678,603,701 | 1,916 | rick-yo | I reproduce this problem on IOS 12.4.4 (real device), and IOS simulator 12.0. | 2020-08-22T06:38:24 | 2020-08-22T06:38:24 | {} | NONE |
vuejs | core | 678,673,231 | 1,934 | bhaidar | Hi @posva
Thanks for your suggestion. I did try it but it seems not working.
The component is receiving a prop. Every time the prop changes we want to run the `fetchData()` function.
Is the `setup()` function running every time a prop changes for example? | 2020-08-22T18:08:38 | 2020-08-22T18:08:38 | {} | NONE |
vuejs | core | 675,833,810 | 1,886 | xxholly32 | nice
I see this problem still cant work in your way the current version 3.0.0-rc.5
https://jsfiddle.net/xxholly32/w7k8vzng/21/ | 2020-08-19T03:42:15 | 2020-08-19T03:42:15 | {} | NONE |
vuejs | core | 676,295,228 | 1,895 | posva | This is related to your TypeScript setup not to Vue.
---
Remember to use the [forum](http://forum.vuejs.org/) or the [Discord chat](https://vue-land.js.org/) to ask questions! | 2020-08-19T12:46:22 | 2020-08-19T12:46:22 | {} | MEMBER |
vuejs | core | 676,747,291 | 1,890 | yyx990803 | What do you mean by "enter" and "leave" in this case? How are you making elements "enter" or "leave" the Teleport? | 2020-08-19T22:04:24 | 2020-08-19T22:04:24 | {} | MEMBER |
vuejs | core | 678,650,434 | 1,932 | SebastianSpeitel | Ok, thanks | 2020-08-22T14:53:05 | 2020-08-22T14:53:05 | {} | NONE |
vuejs | core | 675,537,859 | 1,886 | yyx990803 | With the commit above you should be able to do
```js
contentHtml: {
type: String,
default (props) {
console.log(props.theme)
},
}
```
I think it's best to prohibit `this` usage inside prop default functions and validators. This is technically a breaking change and we will need... | 2020-08-18T15:10:19 | 2020-08-18T15:10:19 | {
"+1": 2
} | MEMBER |
vuejs | core | 677,428,247 | 1,734 | ota-meshi | It's not clear to me yet, so please let me know.
Are you say that it is Vue3's bug that key is not attached, in Case2 and Case4? | 2020-08-20T07:37:02 | 2020-08-20T07:37:02 | {} | MEMBER |
vuejs | core | 677,434,482 | 1,734 | haoqunjiang | Yes, it's Vue 3's bug. | 2020-08-20T07:47:11 | 2020-08-20T07:47:11 | {} | MEMBER |
vuejs | core | 678,338,972 | 1,916 | posva | I could only test on 12.1 on Browserstack but I couldn't find in what version this bug was fixed https://en.wikipedia.org/wiki/IOS_version_history#iOS_12 | 2020-08-21T15:03:21 | 2020-08-21T15:03:21 | {} | MEMBER |
vuejs | core | 678,743,193 | 1,936 | pikax | You don't need to change the types, you can rebuild the instance types without changing the code:
```ts
const Comp = defineComponent({
props: {
foo: {
type: String,
default: ''
}
}
})
type BuildInstance<T> = T extends ComponentOptionsBase<
infer Props,
infer RawBindings,
... | 2020-08-23T08:02:12 | 2020-08-23T08:02:12 | {} | MEMBER |
vuejs | core | 677,715,147 | 1,894 | yyx990803 | No, I don't think it's possible to tell by type. | 2020-08-20T14:54:06 | 2020-08-20T14:54:06 | {} | MEMBER |
vuejs | core | 678,269,307 | 1,919 | HcySunYang | yeah agree | 2020-08-21T12:39:57 | 2020-08-21T12:39:57 | {} | MEMBER |
vuejs | core | 678,354,783 | 1,925 | IamManchanda | ohk cool Evan 👍 @yyx990803 | 2020-08-21T15:35:47 | 2020-08-21T15:35:47 | {} | NONE |
vuejs | core | 678,619,904 | 1,930 | pikax | Not sure if this is a bug, the cause seems to be typescript cannot infer `v` type correctly, which can be fixed by:
```ts
const b: Bar = reactive({
position: position,
callback: (v:any) => {}
});
```
We can add an overload to provide a better error message, this is the error with the overload:
!... | 2020-08-22T09:41:29 | 2020-08-22T09:41:29 | {
"+1": 1
} | MEMBER |
vuejs | core | 678,648,820 | 1,932 | pikax | that would be best.
If you really want the `computed` you can also do:
```ts
const iter = computed(() => {
val.value; // track it
return gen(val);
});
``` | 2020-08-22T14:38:28 | 2020-08-22T14:38:28 | {} | MEMBER |
vuejs | core | 678,650,042 | 1,932 | SebastianSpeitel | > because the computed `cached` the first `gen()`, and because your `watch` is only looking for `val` changes it always executes it.
Not in the console, but the template got rerendered as well. Otherwise the `1` would still be there. | 2020-08-22T14:49:18 | 2020-08-22T14:49:18 | {} | NONE |
vuejs | core | 678,743,279 | 1,938 | HcySunYang | Don't use `index` as the `key`, just modify it to: `:key="item.name"`. | 2020-08-23T08:03:01 | 2020-08-23T08:03:01 | {} | MEMBER |
vuejs | core | 678,748,073 | 1,938 | posva | You need to specify the correct key so Vue reuses the exact element or component. This is highlighted in documentation on the transition section | 2020-08-23T08:54:36 | 2020-08-23T08:54:36 | {} | MEMBER |
vuejs | core | 676,372,033 | 1,898 | HcySunYang | Maybe https://github.com/vuejs/vue-next/pull/1896 is better | 2020-08-19T13:37:44 | 2020-08-19T13:37:44 | {} | MEMBER |
vuejs | core | 676,844,147 | 1,734 | ota-meshi | @sodatea @yyx990803
I missed this, sorry.
I have something I don't understand, so please let me know if you know.
If you check Case 2 and Case 4 below with Vue3 Template Explorer, it seems that key is not used. Do I need to consider when changing the rules? Or are vue actually using the key just not showing it in... | 2020-08-20T01:32:26 | 2020-08-20T01:32:26 | {} | MEMBER |
vuejs | core | 674,969,793 | 1,877 | soultice | It seems the bug occurred due to a change in the $slots functionality that I've missed.
I wouldn't have opened it if I wasn't sure about the problem, yet it seems that I've been too hasty.
My apologies and thank you for your time and effort! | 2020-08-17T16:06:56 | 2020-08-17T16:06:56 | {} | NONE |
vuejs | core | 674,975,306 | 1,864 | yyx990803 | I like this one, thanks for iterating on this! | 2020-08-17T16:17:41 | 2020-08-17T16:17:41 | {
"laugh": 1
} | MEMBER |
vuejs | core | 677,723,542 | 1,341 | yyx990803 | You can already do `InstanceType<typeof myComponent>` | 2020-08-20T15:08:29 | 2020-08-20T15:08:29 | {
"+1": 1
} | MEMBER |
vuejs | core | 678,643,328 | 1,932 | SebastianSpeitel | But `gen` is called, so `val.value` should be accessed? Or does `computed` not invoke inner functions to track dependencies?
| 2020-08-22T13:46:46 | 2020-08-22T13:46:54 | {} | NONE |
vuejs | core | 678,714,024 | 1,886 | beetaa | > nice
>
> I see this problem still cant work in your way the current version 3.0.0-rc.5
>
> [jsfiddle.net/xxholly32/w7k8vzng/21](https://jsfiddle.net/xxholly32/w7k8vzng/21/)
rc.7 is OK. | 2020-08-23T00:39:19 | 2020-08-23T00:39:19 | {
"+1": 1
} | NONE |
vuejs | core | 678,768,228 | 1,935 | unbyte | @Zohenn I found the way to fix it😀. working. | 2020-08-23T12:27:32 | 2020-08-23T12:27:32 | {
"heart": 1
} | CONTRIBUTOR |
vuejs | core | 676,397,452 | 1,898 | HcySunYang | It's weird and it still works correctly even though I do this:
```ts
DefaultFactory<T extends any ? D : T>
``` | 2020-08-19T13:54:33 | 2020-08-19T13:54:33 | {} | MEMBER |
vuejs | core | 676,407,182 | 1,898 | pikax | ```ts
default?: D | DefaultFactory<D extends any ? T : D> | null | undefined, // works
default?: D | DefaultFactory<D extends any ? D : T> | null | undefined, // works
default?: D | DefaultFactory<D extends any ? T : T> | null | undefined, // works
default?: D | DefaultFactory<T> | null | undefined // doesn... | 2020-08-19T14:01:00 | 2020-08-19T14:01:00 | {} | MEMBER |
vuejs | core | 678,649,009 | 1,932 | SebastianSpeitel |
> If you really want the `computed` you can also do:
>
> ```ts
> const iter = computed(() => {
> val.value; // track it
> return gen(val);
> });
> ```
I would do that if the parameter would be so simple, but it's an Array containing reactive objects. | 2020-08-22T14:40:06 | 2020-08-22T14:40:15 | {} | NONE |
vuejs | core | 678,650,228 | 1,932 | pikax | because the template is tracking for `val` changes.
Please if you continue to have questions, please use the [vue discord](https://vue.land/) or [forum](https://forum.vuejs.org/) | 2020-08-22T14:51:06 | 2020-08-22T14:51:06 | {} | MEMBER |
vuejs | core | 675,142,909 | 1,881 | posva | Pleas open an issue on the library repository. Note they might not have a version ready for Vue 3 yet. | 2020-08-17T22:17:59 | 2020-08-17T22:18:40 | {} | MEMBER |
vuejs | core | 676,751,945 | 1,890 | sionzee | At teleport component there is [prop](https://github.com/vuejs/vue-next/blob/517c2b8bdb9ffa53717c10d604ff6db84d50d4f2/packages/runtime-core/src/components/Teleport.ts#L18): `disabled`,
via it you can control when the teleport teleports content or keep it at default location.
I have it disabled in default and enabli... | 2020-08-19T22:09:56 | 2020-08-19T22:10:33 | {} | NONE |
vuejs | core | 677,328,677 | 1,904 | HcySunYang | Fix: #1341 | 2020-08-20T06:43:24 | 2020-08-20T06:44:14 | {} | MEMBER |
vuejs | core | 678,235,204 | 1,919 | HcySunYang | I will fix it later, just use the setBlockTracking instead. | 2020-08-21T11:05:30 | 2020-08-21T11:05:30 | {} | MEMBER |
vuejs | core | 678,330,753 | 1,927 | yyx990803 | This is expected behavior in v3 Strings passed to `h` are always considered native elements. To use components you need to either explicitly import them or, if they are registered globally, resolve them with `resolveComponent` (see https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md... | 2020-08-21T14:49:55 | 2020-08-21T14:49:55 | {
"+1": 1
} | MEMBER |
vuejs | core | 678,413,926 | 1,902 | yyx990803 | Thanks for the PR. Unfortunately this conflicts with #1900
I also tested with using const enum in class fields and turns out TS compiles it into a dynamic field assignment: https://www.typescriptlang.org/play?#code/MYewdgzgLgBApmArgWxgMQDYEMDmEYDeAUDKTAPIDSMAvDAOQBmcEzE9RAvkcNhPmhAhCJMgAdEAIwwBLYDABOcLABNwGAJ4wA2plw... | 2020-08-21T17:53:21 | 2020-08-21T17:53:21 | {} | MEMBER |
vuejs | core | 678,416,927 | 1,917 | yyx990803 | Also - you don't need to explicitly use `Fragment`. Vue 3 render function accepts returning an array so you can just do:
```js
render() {
return html`
<p>Hello</p>
<p>World</p>
<p>${this.count}</p>
<button onClick=${this.increase}>increase</button>
`
}
... | 2020-08-21T18:00:29 | 2020-08-21T18:00:29 | {} | MEMBER |
vuejs | core | 678,646,654 | 1,932 | pikax | > But why did it retrigger the render then?
you can check the flow with `console.log`
```vue
<template>
<div>
<button @click="val += 1" v-text="'Click'" />
<p v-for="(v, i) of iter" :key="i" v-text="v" />
</div>
</template>
<script>
import { computed, ref, watch } from "vue";
function* gen(... | 2020-08-22T14:18:39 | 2020-08-22T14:18:39 | {} | MEMBER |
vuejs | core | 678,746,680 | 1,936 | pikax | Yep.
Forgot to paste the link 🤦♂️ | 2020-08-23T08:38:46 | 2020-08-23T08:38:46 | {} | MEMBER |
vuejs | core | 676,284,267 | 1,891 | pikax | Is not fixed yet.
This is caused by the `DefaultFactory` adding the return value type.
| 2020-08-19T12:38:36 | 2020-08-19T12:38:36 | {} | MEMBER |
vuejs | core | 678,436,562 | 1,900 | RobbinBaauw | Will try! Though class fields aren't saved on the prototype and VNodes don't contain many functions (if any), so I don't think it will help too much. | 2020-08-21T18:46:34 | 2020-08-21T18:46:34 | {} | CONTRIBUTOR |
vuejs | core | 678,622,784 | 1,931 | skirtles-code | ```html
<select id="country" v-model="selectedCountry" @change="fetchData">
```
I believe the problem is that the `change` listener is being called before `v-model` updates `selectedCountry`. | 2020-08-22T10:16:17 | 2020-08-22T10:16:17 | {} | CONTRIBUTOR |
vuejs | core | 678,649,223 | 1,932 | SebastianSpeitel | What I am still wondering about is, why this line
```vue
<p v-for="(v, i) of iter" :key="i" v-text="v" />
```
got rerendert, when val changed but `iter` kept the same. | 2020-08-22T14:41:53 | 2020-08-22T14:42:22 | {} | NONE |
vuejs | core | 676,674,389 | 1,898 | yyx990803 | closed in favor of #1896 | 2020-08-19T20:37:13 | 2020-08-19T20:37:13 | {} | MEMBER |
vuejs | core | 676,686,538 | 1,894 | yyx990803 | I think the current typing is correct - collection types does return true on `isReactive` checks but the reactivity only applies to collection methods. Collection objects do not behave like plain reactive objects (i.e. no reactive properties) | 2020-08-19T20:49:06 | 2020-08-19T20:49:06 | {} | MEMBER |
vuejs | core | 676,754,507 | 1,890 | yyx990803 | > At teleport component there is prop: disabled
You should mention this from the very beginning. I was looking at your code sample and assumed you are explicitly not using it.
If you have state that is controlling the `disabled` prop, then you can just watch that state to perform the DOM side effects. | 2020-08-19T22:13:38 | 2020-08-19T22:13:38 | {} | MEMBER |
vuejs | core | 677,723,729 | 1,904 | yyx990803 | See https://github.com/vuejs/vue-next/issues/1341#issuecomment-677723542
We can add test to make sure it works. | 2020-08-20T15:08:48 | 2020-08-20T15:08:48 | {} | MEMBER |
vuejs | core | 678,417,923 | 1,929 | yyx990803 | Yeah, it's fixed by the same commit (tested from latest `master`) | 2020-08-21T18:02:44 | 2020-08-21T18:02:44 | {} | MEMBER |
vuejs | core | 678,648,351 | 1,932 | SebastianSpeitel | So the best way to fix this for me would be to rather use a method, which returns a new iterator each time instead of computing the iterator itself.
```vue
<template>
<div>
<button @click="val += 1" v-text="'Click'" />
<p v-for="(v, i) of gen()" :key="i" v-text="v" />
</div>
</template>
<script>... | 2020-08-22T14:34:10 | 2020-08-22T14:38:15 | {} | NONE |
vuejs | core | 677,691,860 | 1,910 | underfin | It will be hosited key props.I'm try add code to resolve it ...
` <template v-for="item in items" :key="item"><span/></template>` will be compiled
```
const _Vue = Vue
const { createVNode: _createVNode } = _Vue
const _hoisted_1 = { key: item }
return function render(_ctx, _cache, $props, $setup, $data, $op... | 2020-08-20T14:13:40 | 2020-08-20T14:13:40 | {} | MEMBER |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.