From aef094fb67f6e188b21b0fd2bf77ba8b8663ce89 Mon Sep 17 00:00:00 2001 From: Eliott Vincent Date: Mon, 16 Aug 2021 16:38:46 +0200 Subject: [PATCH 1/6] Bump --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0c8232b..ebc5a44 100644 --- a/package.json +++ b/package.json @@ -46,10 +46,10 @@ } ], "dependencies": { - "clipboard": "^2.0.4", - "vue": "^2.6.9" + "clipboard": "^2.0.4" }, "devDependencies": { + "@vue/compiler-sfc": "^3.2.2", "autoprefixer": "^7.1.5", "babel-core": "^6.26.0", "babel-eslint": "^8.0.1", @@ -73,9 +73,9 @@ "style-loader": "^0.19.0", "uglifyjs-webpack-plugin": "^2.1.2", "url-loader": "^0.6.2", - "vue-loader": "^15.7.0", - "vue-style-loader": "^4.1.2", - "vue-template-compiler": "^2.6.9", + "vue": "^3.2.2", + "vue-loader": "^16.5.0", + "vue-style-loader": "^4.1.3", "webpack": "=4.29.6", "webpack-bundle-analyzer": "^3.3.2", "webpack-cli": "^3.3.11", From cff5702ca16ce4943d0cbfa2a10f131b9f1fdbd9 Mon Sep 17 00:00:00 2001 From: Eliott Vincent Date: Mon, 16 Aug 2021 17:18:46 +0200 Subject: [PATCH 2/6] Migrate all types --- lib/types/json-array.vue | 41 ++++++++++++------------------------ lib/types/json-boolean.vue | 8 +++---- lib/types/json-date.vue | 12 +++++------ lib/types/json-function.vue | 10 ++++----- lib/types/json-number.vue | 10 ++++----- lib/types/json-object.vue | 40 ++++++++++++----------------------- lib/types/json-string.vue | 28 ++++++++++-------------- lib/types/json-undefined.vue | 8 +++---- 8 files changed, 63 insertions(+), 94 deletions(-) diff --git a/lib/types/json-array.vue b/lib/types/json-array.vue index 41758a0..6e405cb 100644 --- a/lib/types/json-array.vue +++ b/lib/types/json-array.vue @@ -1,4 +1,5 @@ + + \ No newline at end of file diff --git a/example/app.css b/example/app.css deleted file mode 100644 index 06dea9f..0000000 --- a/example/app.css +++ /dev/null @@ -1,6 +0,0 @@ -.jv-number-float { - color: #faa !important; -} -.jv-key-node { - display: flex; -} \ No newline at end of file diff --git a/example/app.js b/example/app.js index 5500ea1..edb63b4 100644 --- a/example/app.js +++ b/example/app.js @@ -1,125 +1,13 @@ -import Vue from 'vue' +import { createApp, h } from 'vue' import JsonViewer from '../lib' -import './app.css' +import App from './App.vue' -Vue.use(JsonViewer) - -new Vue({ - el: '#app', +const app = createApp({ render() { - const scopedSlots = { - copy: ({ copied }) => { - if (copied) return - return - }, - } - const onCopied = (copyEvent) => { - alert(`Text successfully copied!\n${copyEvent.text}`); - } - return ( -
- - -
- new Date(time)} - sort> -
- -
- ) - }, - data() { - return { - jsonData: { - total: 25, - limit: 10, - skip: 0, - numbers: 10.11, - success: true, - links: { - previous: undefined, - next: function () {}, - }, - data: [ - { - id: '5968fcad629fa84ab65a5247', - firstname: 'Ada', - link: 'http://google.com', - lastname: 'Lovelace', - awards: null, - known: [ - 'mathematics', - 'computing' - ], - position: { - lat: 44.563836, - lng: 6.495139 - }, - description: `Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, - chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, - the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation, - and published the first algorithm intended to be carried out by such a machine. - As a result, she is sometimes regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.`, - bornAt: new Date('1815-12-10T00:00:00.000Z'), - diedAt: new Date('1852-11-27T00:00:00.000Z') - }, { - id: '5968fcad629fa84ab65a5246', - firstname: 'Grace', - lastname: 'Hopper', - awards: [ - 'Defense Distinguished Service Medal', - 'Legion of Merit', - 'Meritorious Service Medal', - 'American Campaign Medal', - 'World War II Victory Medal', - 'National Defense Service Medal', - 'Armed Forces Reserve Medal', - 'Naval Reserve Medal', - 'Presidential Medal of Freedom' - ], - known: null, - position: { - lat: 43.614624, - lng: 3.879995 - }, - description: `Grace Brewster Murray Hopper (née Murray; December 9, 1906 – January 1, 1992) - was an American computer scientist and United States Navy rear admiral. - One of the first programmers of the Harvard Mark I computer, - she was a pioneer of computer programming who invented one of the first compiler related tools. - She popularized the idea of machine-independent programming languages, which led to the development of COBOL, - an early high-level programming language still in use today.`, - bornAt: new Date('1815-12-10T00:00:00.000Z'), - diedAt: new Date('1852-11-27T00:00:00.000Z') - } - ] - } - } + return h(App) } }) + +app.use(JsonViewer) + +app.mount("#app") diff --git a/lib/index.js b/lib/index.js index b6f5552..529111b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ import JsonView from './json-viewer' -const install = Vue => { - Vue.component('JsonViewer', JsonView) +const install = app => { + app.component('JsonViewer', JsonView) } export default Object.assign(JsonView, { install }) From de51f4d3564191bd8ad1c6b1c90ce57af0098595 Mon Sep 17 00:00:00 2001 From: Eliott Vincent Date: Mon, 16 Aug 2021 17:43:29 +0200 Subject: [PATCH 6/6] Remove TODO --- lib/types/json-string.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/types/json-string.vue b/lib/types/json-string.vue index cb64a8f..36293f1 100644 --- a/lib/types/json-string.vue +++ b/lib/types/json-string.vue @@ -1,9 +1,7 @@