Vue.js

开发工具:IDEA EasyCode插件用法(很实用)

半世苍凉 提交于 2021-02-07 17:43:01
目录 1、前言 2、安装(EasyCode) 3、建立数据库 4、在IDEA配置连接数据库 5、开始生成代码 6、pom.xml 7、Application.yml 8、启动项目 来源: jianshu.com/p/e4192d7c6844 1、前言 Easycode是idea的一个插件,可以直接对数据的表生成entity,controller,service,dao,mapper,无需任何编码,简单而强大。 2、安装(EasyCode) 我这里的话是已经安装好了。 建议大家在安装一个插件,叫做Lombok。 Lombok能通过注解的方式,在编译时自动为属性生成构造器、getter/setter、equals、hashcode、toString方法。出现的神奇就是在源码中没有getter和setter方法,但是在编译生成的字节码文件中有getter和setter方法。 3、建立数据库 -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user` ; CREATE TABLE `user` ( `id` int ( 11 ) NOT NULL , `username` varchar ( 20 )

Vue.js not rendering when trying to generate a PDF using Phantom.js

雨燕双飞 提交于 2021-02-07 14:52:24
问题 In this simple example with hardcoded url my Vue.js components not rendering, plain html get rendered but all places i have a component appear blank. Phantom.js should work normally with Vue.js? var webPage = require('webpage'); var page = webPage.create(); page.viewportSize = { width: 1920, height: 1080 }; page.open("-----------", function start(status) { page.render('test.jpeg', {format: 'jpeg', quality: '100'}); phantom.exit(); }); Quick vue code for who want to help and do the test. <

Vue.js not rendering when trying to generate a PDF using Phantom.js

China☆狼群 提交于 2021-02-07 14:51:14
问题 In this simple example with hardcoded url my Vue.js components not rendering, plain html get rendered but all places i have a component appear blank. Phantom.js should work normally with Vue.js? var webPage = require('webpage'); var page = webPage.create(); page.viewportSize = { width: 1920, height: 1080 }; page.open("-----------", function start(status) { page.render('test.jpeg', {format: 'jpeg', quality: '100'}); phantom.exit(); }); Quick vue code for who want to help and do the test. <

Rendering html tags in Vue.js

时间秒杀一切 提交于 2021-02-07 14:19:37
问题 I have the following code: HTML <div id="app"> <h1> Hello {{superscript('hello')}} </h1> </div> JS new Vue({ el: "#app", data: { }, methods: { superscript(input) { return '<sup>' + input + '</sup>' } } }) I want this to render: Hello hello But instead it renders the tags themselves without turning it into a superscript. JSfiddle: http://jsfiddle.net/agreyfield91/eywraw8t/188244/ Is there a way to add html tags through a Vue.js method? 回答1: Instead of rendering the html, you need to bind it: {

Conditional stylesheet in .vue component

你离开我真会死。 提交于 2021-02-07 13:16:50
问题 I'm working with vue component (cli .vue) I need to have my stylesheet appear only if certain boolean is true/false. Simplest explanation would be something like : When myVar==false , component is not loading styles. <style v-if="myVar" lang="scss"> @import 'mystyles.css' </style> I know it is impossible in that way, but how I'm able to do 'similar' thing? I need to load my styles in vue if user want to use default Styles, if not I need to prevent them from being loaded. My component is used

Conditional stylesheet in .vue component

流过昼夜 提交于 2021-02-07 13:16:41
问题 I'm working with vue component (cli .vue) I need to have my stylesheet appear only if certain boolean is true/false. Simplest explanation would be something like : When myVar==false , component is not loading styles. <style v-if="myVar" lang="scss"> @import 'mystyles.css' </style> I know it is impossible in that way, but how I'm able to do 'similar' thing? I need to load my styles in vue if user want to use default Styles, if not I need to prevent them from being loaded. My component is used

How to do breakpoints in scss file with vuetify?

青春壹個敷衍的年華 提交于 2021-02-07 12:52:33
问题 How to use media query breakpoints in my vuetify application but in scss file? For example bootstrap enable me to do that in scss file: @include media-breakpoint-up(sm) { .custom-class { display: block; } } what is the equivalent in vuetify? I can't find any documention in vuetify website 回答1: You can do it in scss: @import '~vuetify/src/styles/settings/_variables'; @media #{map-get($display-breakpoints, 'sm-and-down')} { .custom-class { display: block; } } ... and you're right there is very

How to do breakpoints in scss file with vuetify?

我是研究僧i 提交于 2021-02-07 12:52:30
问题 How to use media query breakpoints in my vuetify application but in scss file? For example bootstrap enable me to do that in scss file: @include media-breakpoint-up(sm) { .custom-class { display: block; } } what is the equivalent in vuetify? I can't find any documention in vuetify website 回答1: You can do it in scss: @import '~vuetify/src/styles/settings/_variables'; @media #{map-get($display-breakpoints, 'sm-and-down')} { .custom-class { display: block; } } ... and you're right there is very

Vue.js Cannot read property 'length' of null

半城伤御伤魂 提交于 2021-02-07 12:19:44
问题 If I do this: <div class="panel panel-default" v-if="socialiteLogins !== null"> The panel doesn't hide. If I check socialiteLogins === null alone, or with ==, they both return that the object isn't null. It's definitely null though. If I dump it on the page, I get [] as the result. It's an empty json object. So if I try this: <div class="panel panel-default" v-if="socialiteLogins.length !== 0"> The panel still doesn't hide and I get this error: Cannot read property 'length' of null But If I

VueJS get data as object

久未见 提交于 2021-02-07 11:16:28
问题 Here is a VueJS component: <template> <a @click="log">click me<a> </template> <script> export default { data() { return { a: "a", b: "something", foo: { bar: "baz" }, // etc. } }, methods: { log() { // console.log( data ); // ??? } } } </script> I want to access the data from the log function and get it as an object (just like in its declaration). I know I can get data like this : log() { console.log( this.a ); console.log( this.b ); console.log( this.foo ); } But what I want is the whole