mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-20 20:00:37 +03:00
fix value change and height not resize
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
mode: 'development',
|
||||||
entry: './example/app.js',
|
entry: './example/app.js',
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, '../dist'),
|
path: path.join(__dirname, '../dist'),
|
||||||
@@ -9,7 +11,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
devtool: 'cheap-module-source-map',
|
devtool: 'cheap-module-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 8081
|
port: 8081,
|
||||||
|
disableHostCheck: true
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.vue'],
|
extensions: ['.js', '.vue'],
|
||||||
@@ -26,8 +29,8 @@ module.exports = {
|
|||||||
exclude: /node_modules/
|
exclude: /node_modules/
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.s?css$/,
|
||||||
use: ['vue-style-loader', 'css-loader', 'autoprefixer-loader']
|
use: ['vue-style-loader', 'css-loader', 'sass-loader']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||||
@@ -59,5 +62,6 @@ module.exports = {
|
|||||||
template: './example/index.html',
|
template: './example/index.html',
|
||||||
inject: true
|
inject: true
|
||||||
}),
|
}),
|
||||||
|
new VueLoaderPlugin(),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,11 @@ export default {
|
|||||||
expandCode: false
|
expandCode: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value() {
|
||||||
|
this.onResized()
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
jvClass () {
|
jvClass () {
|
||||||
return 'jv-container ' + this.theme + (this.boxed ? ' boxed' : '')
|
return 'jv-container ' + this.theme + (this.boxed ? ' boxed' : '')
|
||||||
@@ -96,6 +101,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
onResized () {
|
onResized () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
console.log(this.$refs.jsonBox.$el.clientHeight)
|
||||||
if (this.$refs.jsonBox.$el.clientHeight >= 250) {
|
if (this.$refs.jsonBox.$el.clientHeight >= 250) {
|
||||||
this.expandableCode = true
|
this.expandableCode = true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-json-viewer",
|
"name": "vue-json-viewer",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"description": "vuejs展示json的组件",
|
"description": "vuejs展示json的组件",
|
||||||
"main": "dist/vue-json-viewer.js",
|
"main": "dist/vue-json-viewer.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
Reference in New Issue
Block a user