mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-18 09:50:33 +03:00
feat: support generating tags directly from metaInfo object
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { clientSequences } from '../shared/escaping'
|
||||
import { getComponentMetaInfo } from '../shared/getComponentOption'
|
||||
import getMetaInfo from '../shared/getMetaInfo'
|
||||
import { isFunction } from '../utils/is-type'
|
||||
import { clientSequences } from '../shared/escaping'
|
||||
import updateClientMetaInfo from './updateClientMetaInfo'
|
||||
|
||||
export default function _refresh (options = {}) {
|
||||
@@ -15,10 +16,14 @@ export default function _refresh (options = {}) {
|
||||
* @return {Object} - new meta info
|
||||
*/
|
||||
return function refresh () {
|
||||
const metaInfo = getMetaInfo(options, this.$root, clientSequences)
|
||||
// collect & aggregate all metaInfo $options
|
||||
const rawInfo = getComponentMetaInfo(options, this.$root)
|
||||
|
||||
const metaInfo = getMetaInfo(options, rawInfo, clientSequences, this.$root)
|
||||
|
||||
const appId = this.$root._vueMeta.appId
|
||||
const tags = updateClientMetaInfo(appId, options, metaInfo)
|
||||
|
||||
// emit "event" with new info
|
||||
if (tags && isFunction(metaInfo.changed)) {
|
||||
metaInfo.changed(metaInfo, tags.addedTags, tags.removedTags)
|
||||
|
||||
Reference in New Issue
Block a user