This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+293
View File
@@ -0,0 +1,293 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [2.4.0](https://github.com/nuxt/vue-meta/compare/v2.3.4...v2.4.0) (2020-06-10)
### Features
* add support for global inject options ([#568](https://github.com/nuxt/vue-meta/issues/568)) ([8b02eb2](https://github.com/nuxt/vue-meta/commit/8b02eb2ac6693b07caeb76efab106af1d4b92988))
### [2.3.4](https://github.com/nuxt/vue-meta/compare/v2.3.3...v2.3.4) (2020-05-26)
### Features
* add amp-boilerplate as boolean attribute (resolves: [#530](https://github.com/nuxt/vue-meta/issues/530)) ([#531](https://github.com/nuxt/vue-meta/issues/531)) ([bb45319](https://github.com/nuxt/vue-meta/commit/bb453195747058d90862d2db20d6a538ef04811f))
### Bug Fixes
* also set ssrAppId for first Vue app when ssrAttribute exists ([4cb5724](https://github.com/nuxt/vue-meta/commit/4cb57240da0fc486e63997d03d78b0639f9c2aa1))
* also set ssrAppId for first Vue app when ssrAttribute exists ([#563](https://github.com/nuxt/vue-meta/issues/563)) ([4664df2](https://github.com/nuxt/vue-meta/commit/4664df2b1f4c972f883aa6f217a110243c8bc0c6))
* auto install plugin in browser ([32fdb20](https://github.com/nuxt/vue-meta/commit/32fdb2001a5cb0b595c9db67d1b5a75da7f85902))
* improve ssr detection when 1st metaInfo component isnt root ([a41b9a7](https://github.com/nuxt/vue-meta/commit/a41b9a73c0b90cf39d9c93fa66fe3e7d59494f77))
* support falsy values in eg body attributes (fix: [#535](https://github.com/nuxt/vue-meta/issues/535)) ([1ef4108](https://github.com/nuxt/vue-meta/commit/1ef41080e72f6a3c745199ff2be1c20e69ba1157))
### [2.3.3](https://github.com/nuxt/vue-meta/compare/v2.3.2...v2.3.3) (2020-02-26)
### Bug Fixes
* memory leak, use hook events (thanks [#522](https://github.com/nuxt/vue-meta/issues/522)) ([21621e1](https://github.com/nuxt/vue-meta/commit/21621e13f53f45eeef5d75c76ed01c7703ad78b9))
* support once (with skip) client side (fix [#498](https://github.com/nuxt/vue-meta/issues/498)) ([c74c645](https://github.com/nuxt/vue-meta/commit/c74c645d1881e22569a2ea7ac0c903a4f6ee2243))
### [2.3.2](https://github.com/nuxt/vue-meta/compare/v2.3.1...v2.3.2) (2020-01-12)
### Bug Fixes
* call afterNavigation after nextTick ([#478](https://github.com/nuxt/vue-meta/issues/478)) ([fa12530](https://github.com/nuxt/vue-meta/commit/fa12530b3ec450338c52dea2873f6913ee3abaf0))
### [2.3.1](https://github.com/nuxt/vue-meta/compare/v2.3.0...v2.3.1) (2019-10-09)
### Bug Fixes
* accept and pass options as second arg for generate ([2ce5177](https://github.com/nuxt/vue-meta/commit/2ce5177))
* still traverse children when metainfo doesnt return object ([#469](https://github.com/nuxt/vue-meta/issues/469)) ([35b7099](https://github.com/nuxt/vue-meta/commit/35b7099))
* try to detect global mixins adding meta info ([#467](https://github.com/nuxt/vue-meta/issues/467)) ([2231ec1](https://github.com/nuxt/vue-meta/commit/2231ec1))
## [2.3.0](https://github.com/nuxt/vue-meta/compare/v2.3.0-beta.0...v2.3.0) (2019-10-03)
## [2.3.0-beta.0](https://github.com/nuxt/vue-meta/compare/v2.2.2...v2.3.0-beta.0) (2019-09-17)
### Bug Fixes
* use computed prop (which uses caching) instead of calling the fn directly ([c344d60](https://github.com/nuxt/vue-meta/commit/c344d60))
### Features
* add option waitOnDestroyed ([f745059](https://github.com/nuxt/vue-meta/commit/f745059))
* add options debounceWait ([d43b77c](https://github.com/nuxt/vue-meta/commit/d43b77c))
* add possibility to add additional meta info ([0ab76ee](https://github.com/nuxt/vue-meta/commit/0ab76ee))
* add support for setting attributes from multiple apps ([d9b0ab2](https://github.com/nuxt/vue-meta/commit/d9b0ab2))
* enable setting refreshOnceOnNavigation during runtime ([9d14387](https://github.com/nuxt/vue-meta/commit/9d14387))
### [2.2.2](https://github.com/nuxt/vue-meta/compare/v2.2.1...v2.2.2) (2019-08-30)
### Bug Fixes
* workaround for memoryleak in destroyed hook ([ec7b1fb](https://github.com/nuxt/vue-meta/commit/ec7b1fb))
* **types:** add "content" property to MetaPropertyEquiv and remove "name" ([#436](https://github.com/nuxt/vue-meta/issues/436)) ([4384f44](https://github.com/nuxt/vue-meta/commit/4384f44))
### [2.2.1](https://github.com/nuxt/vue-meta/compare/v2.2.0...v2.2.1) (2019-08-04)
### Bug Fixes
* dont assign to global console ([2c0c4c3](https://github.com/nuxt/vue-meta/commit/2c0c4c3))
* meta content templates ([#429](https://github.com/nuxt/vue-meta/issues/429)) ([6907f9a](https://github.com/nuxt/vue-meta/commit/6907f9a))
## [2.2.0](https://github.com/nuxt/vue-meta/compare/v2.1.1...v2.2.0) (2019-07-28)
### Features
* support generating tags directly from metaInfo object ([cb2758e](https://github.com/nuxt/vue-meta/commit/cb2758e))
### Tests
* use build/dist for e2e testing ([#421](https://github.com/nuxt/vue-meta/issues/421)) ([0bf0ceb](https://github.com/nuxt/vue-meta/commit/0bf0ceb))
### [2.1.1](https://github.com/nuxt/vue-meta/compare/v2.1.0...v2.1.1) (2019-07-26)
### Bug Fixes
* babel config for rollup ([71b2d52](https://github.com/nuxt/vue-meta/commit/71b2d52))
## [2.1.0](https://github.com/nuxt/vue-meta/compare/v2.0.5...v2.1.0) (2019-07-24)
### Bug Fixes
* also use ssrAppId for client update ([50c0509](https://github.com/nuxt/vue-meta/commit/50c0509))
* don't generate <title> tag if metaInfo.title is null or false ([#409](https://github.com/nuxt/vue-meta/issues/409)) ([39ef287](https://github.com/nuxt/vue-meta/commit/39ef287))
* dont update title on client with falsy value except empty string ([6efcdf1](https://github.com/nuxt/vue-meta/commit/6efcdf1))
### Features
* add option for prepending (no)script to body ([#410](https://github.com/nuxt/vue-meta/issues/410)) ([05163a7](https://github.com/nuxt/vue-meta/commit/05163a7))
* auto add ssrAttribute to htmlAttrs ([9cf6d32](https://github.com/nuxt/vue-meta/commit/9cf6d32))
* enable onload callbacks ([#414](https://github.com/nuxt/vue-meta/issues/414)) ([fc71e1f](https://github.com/nuxt/vue-meta/commit/fc71e1f))
* make ssr app id configurable ([b0c85e5](https://github.com/nuxt/vue-meta/commit/b0c85e5))
* support json content (without disabling sanitizers) ([#415](https://github.com/nuxt/vue-meta/issues/415)) ([51fe6ea](https://github.com/nuxt/vue-meta/commit/51fe6ea))
### Tests
* update browser config ([8c35863](https://github.com/nuxt/vue-meta/commit/8c35863))
### [2.0.5](https://github.com/nuxt/vue-meta/compare/v2.0.4...v2.0.5) (2019-07-11)
### Bug Fixes
* ensure hasAttribute exists on $root.$el ([f1511ac](https://github.com/nuxt/vue-meta/commit/f1511ac))
* only show boolean attrs with truthy value ([1d9072a](https://github.com/nuxt/vue-meta/commit/1d9072a))
### [2.0.4](https://github.com/nuxt/vue-meta/compare/v2.0.3...v2.0.4) (2019-06-22)
### Bug Fixes
* add warning for v1 boolean attribute syntax ([bfeab17](https://github.com/nuxt/vue-meta/commit/bfeab17))
* dont change title when value is undefined (fix [#396](https://github.com/nuxt/vue-meta/issues/396)) ([90f9710](https://github.com/nuxt/vue-meta/commit/90f9710))
### Tests
* enable all getMetaInfo tests again ([24d7fee](https://github.com/nuxt/vue-meta/commit/24d7fee))
### [2.0.3](https://github.com/nuxt/vue-meta/compare/v2.0.2...v2.0.3) (2019-06-11)
### Bug Fixes
* $meta can be called server side before app is initiated ([ecd725d](https://github.com/nuxt/vue-meta/commit/ecd725d))
### [2.0.2](https://github.com/nuxt/vue-meta/compare/v2.0.1...v2.0.2) (2019-06-10)
### Bug Fixes
* correctly transpile builds ([6751d24](https://github.com/nuxt/vue-meta/commit/6751d24))
* use simple polyfilled includes method ([623970d](https://github.com/nuxt/vue-meta/commit/623970d))
### [2.0.1](https://github.com/nuxt/vue-meta/compare/v2.0.0...v2.0.1) (2019-06-09)
### Bug Fixes
* allow _hasMetaInfo to be configurable ([8b7b991](https://github.com/nuxt/vue-meta/commit/8b7b991))
* prevent vue-meta plugin to be installed twice ([094fd9d](https://github.com/nuxt/vue-meta/commit/094fd9d))
### Tests
* prevent plugin install twice ([8ab63b4](https://github.com/nuxt/vue-meta/commit/8ab63b4))
## [2.0.0](https://github.com/nuxt/vue-meta/compare/v2.0.0-rc.2...v2.0.0) (2019-06-09)
### Bug Fixes
* set ssr appId in mounted hook ([2dd1697](https://github.com/nuxt/vue-meta/commit/2dd1697))
* use empty string value for boolean attributes on client side (fixes [#381](https://github.com/nuxt/vue-meta/issues/381)) ([eb4980c](https://github.com/nuxt/vue-meta/commit/eb4980c))
### Features
* **ts:** add microdata meta tag type ([#382](https://github.com/nuxt/vue-meta/issues/382)) ([11c8138](https://github.com/nuxt/vue-meta/commit/11c8138))
### Tests
* add type tests to circleci ([c6180af](https://github.com/nuxt/vue-meta/commit/c6180af))
* fix ssr hydration tests ([fc57998](https://github.com/nuxt/vue-meta/commit/fc57998))
## [2.0.0-rc.2](https://github.com/nuxt/vue-meta/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-06-06)
### Bug Fixes
* detect and apply changes triggered before or during initialization ([#377](https://github.com/nuxt/vue-meta/issues/377)) ([34c6ad9](https://github.com/nuxt/vue-meta/commit/34c6ad9))
### Features
* add basic support for multiple apps on one page ([#373](https://github.com/nuxt/vue-meta/issues/373)) ([024e7c5](https://github.com/nuxt/vue-meta/commit/024e7c5))
# [2.0.0-rc.1](https://github.com/nuxt/vue-meta/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2019-04-23)
### Bug Fixes
* move addNavGuards check to mounted hook ([e80643b](https://github.com/nuxt/vue-meta/commit/e80643b)), closes [#348](https://github.com/nuxt/vue-meta/issues/348)
* use timers instead of requestAnimationFrame ([c040de7](https://github.com/nuxt/vue-meta/commit/c040de7)), closes [#313](https://github.com/nuxt/vue-meta/issues/313)
# [2.0.0-rc.0](https://github.com/nuxt/vue-meta/compare/v1.6.0...v2.0.0-rc.0) (2019-04-20)
### Bug Fixes
* add afterNavigation type ([722786d](https://github.com/nuxt/vue-meta/commit/722786d))
* add inject stub for browser build ([02e4094](https://github.com/nuxt/vue-meta/commit/02e4094))
* add ts type for refresh once ([5935cf3](https://github.com/nuxt/vue-meta/commit/5935cf3))
* afterNavigation logic (its never set in options) ([4a8f975](https://github.com/nuxt/vue-meta/commit/4a8f975))
* also render boolean attributes correctly for tags ([66e4fb4](https://github.com/nuxt/vue-meta/commit/66e4fb4))
* another inline array to const ([78f2c46](https://github.com/nuxt/vue-meta/commit/78f2c46))
* dev env name ([502c89e](https://github.com/nuxt/vue-meta/commit/502c89e))
* dont call changed with explicit this ([5ad6711](https://github.com/nuxt/vue-meta/commit/5ad6711))
* dont inline typeof definitions ([5031acf](https://github.com/nuxt/vue-meta/commit/5031acf))
* dont updateTags when the new info is not an array ([12c7949](https://github.com/nuxt/vue-meta/commit/12c7949))
* dont use object.assign/spread ([d717dbf](https://github.com/nuxt/vue-meta/commit/d717dbf))
* fix cjs build (for now) by adding var window ([95c138e](https://github.com/nuxt/vue-meta/commit/95c138e))
* ignore cssText for coverage ([e3fd8ab](https://github.com/nuxt/vue-meta/commit/e3fd8ab))
* ignore data when its not an object (fixes: [#253](https://github.com/nuxt/vue-meta/issues/253), [#279](https://github.com/nuxt/vue-meta/issues/279), [#297](https://github.com/nuxt/vue-meta/issues/297)) ([7615f41](https://github.com/nuxt/vue-meta/commit/7615f41))
* ignore package-lock not yarn.lock ([164cd8e](https://github.com/nuxt/vue-meta/commit/164cd8e))
* implement simply array polyfills (fixes [#328](https://github.com/nuxt/vue-meta/issues/328)) ([d38f81e](https://github.com/nuxt/vue-meta/commit/d38f81e))
* move rollup config and case fix ([76632ad](https://github.com/nuxt/vue-meta/commit/76632ad))
* one less thing to review ([bf864f6](https://github.com/nuxt/vue-meta/commit/bf864f6))
* only add navguards when refreshOnceOnNav is false ([93f021b](https://github.com/nuxt/vue-meta/commit/93f021b))
* prefer filter over slice ([82ba8c0](https://github.com/nuxt/vue-meta/commit/82ba8c0))
* prefer for..in instead keys.forEach ([6741897](https://github.com/nuxt/vue-meta/commit/6741897))
* prefer includes over indexOf ([6bbcf74](https://github.com/nuxt/vue-meta/commit/6bbcf74))
* remove leaked poc dependencies ([0dada3d](https://github.com/nuxt/vue-meta/commit/0dada3d))
* remove only descriptors ([c08e461](https://github.com/nuxt/vue-meta/commit/c08e461))
* rollup paths ([bfbd181](https://github.com/nuxt/vue-meta/commit/bfbd181))
* trigger meta refresh on page load (fixes [#283](https://github.com/nuxt/vue-meta/issues/283)) ([b824a27](https://github.com/nuxt/vue-meta/commit/b824a27))
* typo ([3631526](https://github.com/nuxt/vue-meta/commit/3631526))
* use Array.from ([f9604c0](https://github.com/nuxt/vue-meta/commit/f9604c0))
* use const arrays ([288871f](https://github.com/nuxt/vue-meta/commit/288871f))
* use correct var ([1e6c5b9](https://github.com/nuxt/vue-meta/commit/1e6c5b9))
* use single object prop on ([9c80dab](https://github.com/nuxt/vue-meta/commit/9c80dab))
* use undefined as child ignore indicator ([104113a](https://github.com/nuxt/vue-meta/commit/104113a))
### Features
* add afterNavigation callback (fix: [#259](https://github.com/nuxt/vue-meta/issues/259)) ([97badf6](https://github.com/nuxt/vue-meta/commit/97badf6))
* add amp as boolean attribute (resolves: [#311](https://github.com/nuxt/vue-meta/issues/311)) ([b7ee040](https://github.com/nuxt/vue-meta/commit/b7ee040))
* add browser build without ssr code ([2862a5b](https://github.com/nuxt/vue-meta/commit/2862a5b))
* add es build ([56f0b61](https://github.com/nuxt/vue-meta/commit/56f0b61))
* add getOptions method (resolves: [#215](https://github.com/nuxt/vue-meta/issues/215)) ([31e975d](https://github.com/nuxt/vue-meta/commit/31e975d))
* add option to refresh once during navigation (possible fix for [#320](https://github.com/nuxt/vue-meta/issues/320)) ([8e21175](https://github.com/nuxt/vue-meta/commit/8e21175))
* add pause/resume methods to pause updates ([d237180](https://github.com/nuxt/vue-meta/commit/d237180))
* attr keys can have array values (resolves [#231](https://github.com/nuxt/vue-meta/issues/231)) ([01edc8c](https://github.com/nuxt/vue-meta/commit/01edc8c))
* child can indicate its content should be ignored (resolves: [#204](https://github.com/nuxt/vue-meta/issues/204)) ([22e456c](https://github.com/nuxt/vue-meta/commit/22e456c))
* child can indicate parent vmid to be removed (resolves: [#288](https://github.com/nuxt/vue-meta/issues/288)) ([915fedf](https://github.com/nuxt/vue-meta/commit/915fedf))
* export hasMetaInfo helper function ([173b31d](https://github.com/nuxt/vue-meta/commit/173b31d))
* major refactor, cleanup and jest tests ([5d64d43](https://github.com/nuxt/vue-meta/commit/5d64d43))
* **ts:** update types for v2 ([#338](https://github.com/nuxt/vue-meta/issues/338)) ([7b85ff2](https://github.com/nuxt/vue-meta/commit/7b85ff2))
* render boolean attributes correctly (previously [#317](https://github.com/nuxt/vue-meta/issues/317)) ([deea5cf](https://github.com/nuxt/vue-meta/commit/deea5cf))
* track branches which contain metaInfo components ([f2e8eb5](https://github.com/nuxt/vue-meta/commit/f2e8eb5))
* use named exports to export helper functions ([95c3b7d](https://github.com/nuxt/vue-meta/commit/95c3b7d))
+24
View File
@@ -0,0 +1,24 @@
MIT License
Copyright (c) 2016-2019
- Declan de Wet
- Sébastien Chopin
- All the amazing contributors (https://github.com/nuxt/vue-meta/graphs/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+133
View File
@@ -0,0 +1,133 @@
<p align="center">
<img src="./docs/.vuepress/public/vue-meta.png" alt="vue-meta" />
</p>
<h5 align="center">
Manage HTML metadata in Vue.js components with SSR support
</h5>
<p align="center">
<a href="http://npm-stat.com/charts.html?package=vue-meta"><img src="https://img.shields.io/npm/dm/vue-meta.svg" alt="npm downloads"></a>
<a href="http://npmjs.org/package/vue-meta"><img src="https://img.shields.io/npm/v/vue-meta.svg" alt="npm version"></a>
<a href="https://codecov.io/gh/nuxt/vue-meta"><img src="https://badgen.net/codecov/c/github/nuxt/vue-meta/master" alt="Coverage Status"></a>
<a href="https://circleci.com/gh/nuxt/vue-meta/"><img src="https://badgen.net/circleci/github/nuxt/vue-meta" alt="Build Status"></a>
<a href="https://david-dm.org/nuxt/vue-meta"><img src="https://david-dm.org/nuxt/vue-meta/status.svg" alt="dependencies Status"></a>
<a href="https://discord.nuxtjs.org/"><img src="https://badgen.net/badge/Discord/join-us/7289DA" alt="Discord"></a>
</p>
```html
<template>
...
</template>
<script>
export default {
metaInfo: {
title: 'My Example App',
titleTemplate: '%s - Yay!',
htmlAttrs: {
lang: 'en',
amp: true
}
}
}
</script>
```
```html
<html lang="en" amp>
<head>
<title>My Example App - Yay!</title>
...
</head>
```
# Introduction
Vue Meta is a [Vue.js](https://vuejs.org) plugin that allows you to manage your app's metadata. It is inspired by and works similar as [`react-helmet`](https://github.com/nfl/react-helmet) for react. However, instead of setting your data as props passed to a proprietary component, you simply export it as part of your component's data using the `metaInfo` property.
These properties, when set on a deeply nested component, will cleverly overwrite their parent components' `metaInfo`, thereby enabling custom info for each top-level view as well as coupling metadata directly to deeply nested subcomponents for more maintainable code.
## Documentation
Please find the documention on https://vue-meta.nuxtjs.org
> :globe_with_meridians: Please help us translate the documentation into your language, see [here](#how-to-translate-documentation) for more information
## Examples
Looking for more examples what vue-meta can do for you? Have a look at the [examples](https://github.com/nuxt/vue-meta/tree/master/examples)
## Installation
##### Yarn
```sh
$ yarn add vue-meta
```
##### npm
```sh
$ npm install vue-meta --save
```
##### Download / CDN
Use the download links below - if you want a previous version, check the instructions at https://unpkg.com.
Latest version: https://unpkg.com/vue-meta/dist/vue-meta.min.js
Latest v1.x version: https://unpkg.com/vue-meta@1/dist/vue-meta.min.js
**Uncompressed:**
```html
<script src="https://unpkg.com/vue-meta/dist/vue-meta.js"></script>
```
**Minified:**
```html
<script src="https://unpkg.com/vue-meta/dist/vue-meta.min.js"></script>
```
## Quick Usage
See the [documentation](https://vue-meta.nuxtjs.org) for more information
```js
import Vue from 'vue'
import VueMeta from 'vue-meta'
Vue.use(VueMeta, {
// optional pluginOptions
refreshOnceOnNavigation: true
})
```
## Frameworks using vue-meta
If you wish to create your app even more quickly, take a look at the following frameworks which use vue-meta
- [Nuxt.js](https://github.com/nuxt/nuxt.js) - The Vue.js Progressive Framework
- [Gridsome](https://github.com/gridsome/gridsome) - The Vue.js JAMstack Framework
- [Ream](https://github.com/ream/ream) - Framework for building universal web app and static website in Vue.js
- [Vue-Storefront](https://github.com/DivanteLtd/vue-storefront) - PWA for eCommerce
- [Factor JS](https://github.com/fiction-com/factor) - Extension-first VueJS platform for front-end developers.
## How to translate documentation
Thanks for your interest in translating the documentation. As our docs are based on VuePress, we recommend to have a look at their docs about [internationalization](https://vuepress.vuejs.org/guide/i18n.html#site-level-i18n-config) as well
Here are the steps you will need to take:
- Clone this repository
- Create a new branch
- Browse to `/docs/`
- Create a folder with the language code you will add a translation for (eg `/zh/`)
- Copy all `*.md` files and the folders `api`, `faq`, and `guide` to that folder
- Translate the copied files in your language folder
- Edit `.vuepress/config.yml` and add a config section for your locale in both `locales` as `themeConfig.locales`
- Test your translation by running the docs dev server with `yarn docs`
- Create a pull request with your changes
- Receive eternal gratefulness from your fellow language speakers :heart:
## Old versions
Click [here](https://github.com/nuxt/vue-meta/tree/1.x) if you are looking for the old v1 readme
## License
[MIT](./LICENSE.md)
+2017
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+2013
View File
File diff suppressed because it is too large Load Diff
+1737
View File
File diff suppressed because it is too large Load Diff
+10
View File
File diff suppressed because one or more lines are too long
+161
View File
@@ -0,0 +1,161 @@
{
"_args": [
[
"vue-meta@2.4.0",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
]
],
"_from": "vue-meta@2.4.0",
"_id": "vue-meta@2.4.0",
"_inBundle": false,
"_integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==",
"_location": "/vue-meta",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "vue-meta@2.4.0",
"name": "vue-meta",
"escapedName": "vue-meta",
"rawSpec": "2.4.0",
"saveSpec": null,
"fetchSpec": "2.4.0"
},
"_requiredBy": [
"/@nuxt/vue-app",
"/@nuxt/vue-renderer"
],
"_resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.4.0.tgz",
"_spec": "2.4.0",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"bugs": {
"url": "https://github.com/nuxt/vue-meta/issues"
},
"contributors": [
{
"name": "Declan de Wet",
"url": "@declandewet"
},
{
"name": "Sebastien Chopin",
"url": "@Atinux"
},
{
"name": "Pim",
"url": "@pimlie"
}
],
"dependencies": {
"deepmerge": "^4.2.2"
},
"description": "Manage HTML metadata in Vue.js components with ssr support",
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/node": "^7.10.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.10.2",
"@nuxtjs/eslint-config": "^3.0.0",
"@vue/server-test-utils": "^1.0.3",
"@vue/test-utils": "^1.0.3",
"@vuepress/plugin-google-analytics": "^1.5.1",
"@vuepress/plugin-pwa": "^1.5.1",
"babel-core": "^7.0.0-bridge",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"babel-loader": "^8.1.0",
"babel-plugin-dynamic-import-node": "^2.3.3",
"browserstack-local": "^1.4.5",
"chromedriver": "^83.0.0",
"codecov": "^3.7.0",
"copy-webpack-plugin": "^6.0.2",
"eslint": "^7.2.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-jest": "^23.13.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"esm": "^3.2.25",
"fs-extra": "^9.0.1",
"geckodriver": "^1.19.1",
"get-port": "^5.1.1",
"hable": "3.0.0",
"is-wsl": "^2.2.0",
"jest": "^26.0.1",
"jest-environment-jsdom": "^26.0.1",
"jest-environment-jsdom-global": "^2.0.2",
"jsdom": "^16.2.2",
"lodash": "^4.17.15",
"node-env-file": "^0.1.8",
"puppeteer-core": "^3.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.15.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^6.1.0",
"selenium-webdriver": "^4.0.0-alpha.7",
"standard-version": "^8.0.0",
"tib": "^0.7.4",
"typescript": "^3.9.5",
"vue": "^2.6.11",
"vue-jest": "^3.0.5",
"vue-loader": "^15.9.2",
"vue-router": "^3.3.2",
"vue-server-renderer": "^2.6.11",
"vue-template-compiler": "^2.6.11",
"vuepress": "^1.5.1",
"vuepress-theme-vue": "^1.1.0",
"webpack": "^4.43.0"
},
"files": [
"dist",
"types/*.d.ts"
],
"homepage": "https://github.com/nuxt/vue-meta",
"keywords": [
"attribute",
"google",
"head",
"helmet",
"info",
"metadata",
"meta",
"seo",
"server",
"ssr",
"title",
"universal",
"vue"
],
"license": "MIT",
"main": "dist/vue-meta.common.js",
"module": "dist/vue-meta.esm.js",
"name": "vue-meta",
"repository": {
"type": "git",
"url": "git@github.com/nuxt/vue-meta.git"
},
"scripts": {
"build": "rimraf dist && rollup -c scripts/rollup.config.js",
"coverage": "codecov",
"dev": "cd examples && yarn dev && cd ..",
"docs": "vuepress dev --host 0.0.0.0 --port 3000 docs",
"docs:build": "vuepress build docs",
"lint": "eslint src test",
"prerelease": "git checkout master && git pull -r",
"release": "yarn lint && yarn test && standard-version",
"test": "yarn test:unit && yarn test:e2e-ssr && yarn test:e2e-browser",
"test:e2e-browser": "jest test/e2e/browser",
"test:e2e-ssr": "jest test/e2e/ssr",
"test:types": "tsc -p types/test",
"test:unit": "jest test/unit"
},
"typings": "types/index.d.ts",
"version": "2.4.0",
"web": "dist/vue-meta.js"
}
+28
View File
@@ -0,0 +1,28 @@
import './vue'
import { VueMeta } from './vue-meta'
export default VueMeta
export {
VueMetaOptions,
VueMetaPlugin,
VueMetaApp,
MetaInfo,
MetaInfoSSR,
AttributeProperty,
LinkPropertyBase,
LinkPropertyHref,
LinkPropertyHrefCallback,
MetaPropertyCharset,
MetaPropertyEquiv,
MetaPropertyName,
MetaPropertyMicrodata,
MetaPropertyProperty,
NoScriptProperty,
ScriptPropertyBase,
ScriptPropertyText,
ScriptPropertySrc,
ScriptPropertySrcCallback,
ScriptPropertyJson,
StyleProperty
} from './vue-meta'
+239
View File
@@ -0,0 +1,239 @@
import './vue'
import Vue, { ComponentOptions, PluginFunction } from 'vue'
type Component = ComponentOptions<Vue> | typeof Vue
type CallbackFn = () => void
type elements = HTMLElement[]
export interface VueMetaOptionsRuntime {
refreshOnceOnNavigation?: boolean
debounceWait?: number
waitOnDestroyed?: boolean
}
export interface VueMetaOptions extends VueMetaOptionsRuntime {
keyName: string, // the component option name that vue-meta looks for meta info on.
attribute: string, // the attribute name vue-meta adds to the tags it observes
ssrAppId: string, // the app id used for ssr app
ssrAttribute: string, // the attribute name that lets vue-meta know that meta info has already been server-rendered
tagIDKeyName: string // the property name that vue-meta uses to determine whether to overwrite or append a tag
}
export declare class VueMeta {
static version: string
static install(vue: typeof Vue, options?: VueMetaOptions): PluginFunction<never>
static hasMetaInfo(vm: Component): boolean
static generate(metaInfo: MetaInfo, options?: Object): MetaInfoSSR
}
interface RefreshedTags {
addedTags: elements
removedTags: elements
}
interface Refreshed {
vm: Component,
metaInfo: MetaInfoOutput,
tags: RefreshedTags
}
interface VueMetaApp {
set(metaInfo: MetaInfo): void | RefreshedTags
remove(): void
}
export interface VueMetaPlugin {
getOptions(): VueMetaOptions
setOptions(runtimeOptions: VueMetaOptionsRuntime): VueMetaOptions
addApp(appName: string): VueMetaApp
refresh(): Refreshed
inject(): MetaInfoSSR
pause(refresh: true): () => Refreshed
pause(refresh?: boolean): () => void
resume(refresh: true): Refreshed
resume(refresh?: boolean): void
}
export interface AttributeProperty {
[key: string]: string | string[]
}
export interface MetaDataProperty {
vmid?: string,
once?: boolean,
skip?: boolean,
body?: boolean,
pbody?: boolean,
[key: string]: any
}
export interface MetaPropertyCharset extends MetaDataProperty {
charset: string,
}
export interface MetaPropertyEquiv extends MetaDataProperty {
httpEquiv: string,
content: string,
template?: (chunk: string) => string
}
export interface MetaPropertyName extends MetaDataProperty {
name: string,
content: string,
template?: (chunk: string) => string
}
export interface MetaPropertyMicrodata extends MetaDataProperty {
itemprop: string,
content: string,
template?: (chunk: string) => string
}
// non-w3c interface
export interface MetaPropertyProperty extends MetaDataProperty {
property: string,
content: string,
template?: (chunk: string) => string
}
export interface LinkPropertyBase extends MetaDataProperty {
rel: string,
crossOrigin?: string | null,
media?: string,
nonce?: string,
referrerPolicy?: string,
rev?: string,
type?: string
}
export interface LinkPropertyHref extends LinkPropertyBase {
href?: string,
hreflang?: string,
callback?: void
}
export interface LinkPropertyHrefCallback extends LinkPropertyBase {
vmid: string,
callback: CallbackFn,
href?: string,
hreflang?: string
}
export interface StyleProperty extends MetaDataProperty {
cssText: string,
callback?: CallbackFn
media?: string,
nonce?: string,
type?: string,
}
export interface ScriptPropertyBase extends MetaDataProperty {
type?: string,
charset?: string,
async?: boolean,
defer?: boolean,
crossOrigin?: string,
nonce?: string
}
export interface ScriptPropertyText extends ScriptPropertyBase {
innerHTML: string
}
export interface ScriptPropertySrc extends ScriptPropertyBase {
src: string,
callback?: void
}
export interface ScriptPropertySrcCallback extends ScriptPropertyBase {
vmid: string,
callback: CallbackFn
}
type JsonVal = string | number | boolean | JsonObj | JsonObj[] | null
interface JsonObj {
[key: string]: JsonVal | JsonVal[]
}
export interface ScriptPropertyJson extends ScriptPropertyBase {
json: JsonObj
}
export interface NoScriptProperty extends MetaDataProperty {
innerHTML: string,
}
export interface MetaInfo {
title?: string
titleTemplate?: string | ((titleChunk: string) => string),
htmlAttrs?: AttributeProperty
headAttrs?: AttributeProperty
bodyAttrs?: AttributeProperty
base?: {
target: string,
href: string
}
meta?: (MetaPropertyCharset | MetaPropertyEquiv | MetaPropertyName | MetaPropertyMicrodata | MetaPropertyProperty)[]
link?: (LinkPropertyBase | LinkPropertyHref | LinkPropertyHrefCallback)[]
style?: StyleProperty[]
script?: (ScriptPropertyText | ScriptPropertySrc | ScriptPropertySrcCallback | ScriptPropertyJson)[]
noscript?: NoScriptProperty[]
__dangerouslyDisableSanitizers?: string[]
__dangerouslyDisableSanitizersByTagID?: {
[key: string]: string[]
}
changed?: <T extends MetaInfoOutput>(newInfo: T, addedTags: elements, removedTags: elements) => void
afterNavigation?: <T extends MetaInfoOutput>(newInfo: T) => void
}
export interface MetaInfoOutput extends MetaInfo {
titleChunk?: string
}
export type MetaInfoComputed = () => MetaInfo
interface ToText {
text(): string
}
interface ToTextBooleanArg {
text(addSrrAttribute?: boolean): string
}
interface AddLineBreakOption {
ln: boolean
}
interface ToBodyTextOption {
body: boolean
}
interface ToPbodyTextOption {
pbody: boolean
}
interface ToBodyText {
text(options?: (ToBodyTextOption | ToPbodyTextOption | AddLineBreakOption)): string
}
export interface MetaInfoSSR {
head(ln?: boolean): string
bodyPrepend(ln?: boolean): string
bodyAppend(ln?: boolean): string
title?: ToText
htmlAttrs?: ToTextBooleanArg
headAttrs?: ToText
bodyAttrs?: ToText
base?: ToBodyText
meta?: ToBodyText
link?: ToBodyText
style?: ToBodyText
script?: ToBodyText
noscript?: ToBodyText
}
+18
View File
@@ -0,0 +1,18 @@
/**
* Augment the typings of Vue.js
*/
import Vue, { ComponentOptions } from 'vue'
import { MetaInfo, MetaInfoComputed, VueMetaPlugin } from './vue-meta'
declare module 'vue/types/vue' {
interface Vue {
$meta(): VueMetaPlugin
}
}
declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
metaInfo?: MetaInfo | MetaInfoComputed
}
}