From 5add8bf83f597e9576b3a4502d6d7a0f1a76014c Mon Sep 17 00:00:00 2001 From: pimlie Date: Sun, 2 Aug 2020 21:43:55 +0200 Subject: [PATCH] feat: make attributes part of the metainfo object feat: support removing old attributes feat: better support content as either attribute or child --- examples/vue-router/app.js | 13 +++- src/Metainfo.ts | 46 +++---------- src/config/default.ts | 28 +++----- src/config/helpers.ts | 4 +- src/config/tags.ts | 4 ++ src/index.ts | 1 + src/info/resolve.ts | 2 +- src/manager.ts | 3 +- src/render.ts | 138 ++++++++++++++++++++++++++++--------- src/types/index.ts | 16 +++++ 10 files changed, 163 insertions(+), 92 deletions(-) diff --git a/examples/vue-router/app.js b/examples/vue-router/app.js index c81c9c0..3d57a47 100644 --- a/examples/vue-router/app.js +++ b/examples/vue-router/app.js @@ -86,8 +86,18 @@ const App = { ] }, body: 'body-script1.js', + htmlAttrs: { + amp: true, + lang: ['en', 'nl'] + }, + bodyAttrs: { + class: ['theme-dark'] + }, script: [ { src: 'head-script1.js' }, + { json: { '@context': 'http://schema.org', unsafe: '

hello

' } }, + { content: 'window.a = "
";