Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

chore: bump @vue/composition-api, fix #244 #251

Merged
merged 6 commits into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"pre-commit": "lint-staged"
},
"dependencies": {
"@vue/composition-api": "1.0.0-beta.14",
"@vue/composition-api": "1.0.0-beta.16",
"defu": "^3.1.0",
"normalize-path": "^3.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
getCurrentInstance,
h,
inject,
isRaw,
isReactive,
isReadonly,
isRef,
Expand Down
5 changes: 3 additions & 2 deletions src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
isRef,
onBeforeMount,
onServerPrefetch,
set,
} from '@vue/composition-api'

import { globalContext, globalNuxt, isFullStatic } from './globals'
Expand Down Expand Up @@ -137,7 +138,7 @@ const loadFullStatic = (vm: AugmentedComponentInstance) => {

// Merge data
for (const key in data) {
Vue.set(vm.$data, key, data[key])
set(vm.$data, key, data[key])
}
}

Expand Down Expand Up @@ -263,7 +264,7 @@ export const useFetch = (callback: Fetch) => {
if (key in vm && typeof vm[key as keyof typeof vm] === 'function') {
continue
}
Vue.set(vm, key, data[key])
set(vm, key, data[key])
} catch (e) {
if (process.env.NODE_ENV === 'development')
// eslint-disable-next-line
Expand Down
7 changes: 4 additions & 3 deletions src/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
watch,
UnwrapRef,
customRef,
set,
} from '@vue/composition-api'

import type { MetaInfo } from 'vue-meta'
Expand All @@ -28,7 +29,7 @@ type MetaInfoMapper<T> = {

function assign<T extends Record<string, any>>(target: T, source: Partial<T>) {
Object.entries(source).forEach(([key, value]) => {
Vue.set(target, key, value)
set(target, key, value)
})
return target
}
Expand Down Expand Up @@ -102,7 +103,7 @@ export const useMeta = <T extends MetaInfo>(init?: T) => {
'In order to enable `useMeta`, please make sure you include `head: {}` within your component definition, and you are using the `defineComponent` exported from @nuxtjs/composition-api.'
)

const { _head } = vm.$options as { _head: ReactiveHead }
const { _head = reactive({}) as ReactiveHead } = vm.$options

assign(_head, createEmptyMeta())
assign<MetaInfo>(_head, init || {})
Expand All @@ -122,7 +123,7 @@ export const useMeta = <T extends MetaInfo>(init?: T) => {
},
set(newValue) {
if (!_head.titleTemplate) {
Vue.set(_head, 'titleTemplate', newValue)
set(_head, 'titleTemplate', newValue)
} else {
_head.titleTemplate = newValue
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2296,10 +2296,10 @@
optionalDependencies:
prettier "^1.18.2"

"@vue/[email protected].14":
version "1.0.0-beta.14"
resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.0.0-beta.14.tgz#b243d906ae5dcda7483e0b5a2b5ea1aa971a4e00"
integrity sha512-HYBe87RG//qpN/2+ZtgdhrIafdO8bYK/Tu1+/jMS4iNGYJi42XCbPydhEAiaRcTvsEJjZQEfP+hKKIuH+iPICg==
"@vue/[email protected].16":
version "1.0.0-beta.16"
resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.0.0-beta.16.tgz#9f7202125214e9398f68018c1162b57b14fd0bdc"
integrity sha512-FZgmL2qb2Hy3TGFKCEXHwaddFdTfG17GoA1YFCNGTg5mD3+GfWVchsKKR7XxHIAwOaXiHK/djWWsviSD1NeFFw==
dependencies:
tslib "^2.0.1"

Expand Down