
Vue.js
文章平均质量分 61
米尔大哥
这个作者很懒,什么都没留下…
展开
-
vue 如何在关闭对话框时将表单重置为空
closeForm方法如下:closeForm() { this.$refs.ruleForm.resetFields()}原创 2020-10-29 16:12:30 · 986 阅读 · 1 评论 -
drf 排序
1.views 文件中from rest_framework.filters import OrderingFilterclass ModuleView(mixins.ListModelMixin, mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, GenericViewSet): queryset = models.Module.objects.f原创 2020-10-24 11:03:26 · 505 阅读 · 0 评论 -
drf 查询
1.在utils文件夹中创建filters.py 文件,内容如下from django_filters.rest_framework.filterset import FilterSetfrom api import modelsfrom django_filters import filtersclass ModuleFilterSet(FilterSet): moduleName = filters.CharFilter(field_name='moduleName', look原创 2020-10-24 11:01:28 · 680 阅读 · 0 评论 -
drf 分页
drf实现分页1.在utils文件夹中新建一个paginations文件,内容如下from rest_framework.pagination import PageNumberPaginationclass MyPageNumberPagination(PageNumberPagination): page_query_param = 'page' page_size_query_param = 'limit' page_size = 10 max_page原创 2020-10-24 10:53:07 · 219 阅读 · 0 评论 -
vue 登录时的哨兵模式
router.beforeEach((to, from, next) => { if (to.path === '/login') return next() const token = sessionStorage.getItem('token') if (!token) return next('/login') next()})原创 2020-10-23 10:29:37 · 320 阅读 · 0 评论 -
vue 输入框中按enter键实现搜索或提交
@keydown.enter.native="login" 这样既可原创 2020-10-23 10:19:14 · 2436 阅读 · 2 评论 -
在vue中引入Bootstrap4并且安装axios和vue-axios
1.cd myweb 进入我的项目2.npm install --save jquery popper.js 安装jquery3.npm install bootstrap --save --save-exact 安装bootstrap4.在main.js中引入bootstrap:import 'bootstrap/dist/css/bootstrap.min.c...原创 2019-06-02 11:41:27 · 1881 阅读 · 0 评论 -
django+vue环境搭建
1.下载并安装python3.6,可以默认安装至c盘。2.安装virtualenv,安装命令:pip install virtualenv3.在F盘创建虚拟环境,virtualenv virtualenv_014.进入F:\virtualenv_01\Scripts,cmd然后输入activate就进入该虚拟环境了。5.安装django 2.0 ,输入命令:pip instal...原创 2018-12-14 17:44:26 · 1098 阅读 · 0 评论 -
Vue-multiselect 插件使用--搜索及单选下拉框
参考官网:https://vue-multiselect.js.org/#sub-select-with-search1.通过npm安装vue-multiselectnpm install vue-multiselect 2.引用template中:注意这里的track-by是name,下面准备的数据的key也应该是name<multiselect class="mu...原创 2018-12-14 11:49:09 · 9267 阅读 · 1 评论 -
在vue中安装scss(sass)
1.命令行执行安装npm install node-sass --save-dev //安装node-sass npm install sass-loader --save-dev //安装sass-loader npm install style-loader --save-dev //安装style-loader 有些人安装的是 vue-style-loader 其实是一样的!2...原创 2018-12-13 15:31:02 · 1984 阅读 · 0 评论 -
npm install出现: Unexpected end of JSON input while parsing near
把Nodejs更新到最新版,来新的项目npm install出现了这个错误。查了一下应该时因为最新版的Nodejs与npm版本不合适的问题(因为没更新Node之前是不会的)。解决办法就是把npm的版本降到4版。清除缓存:npm cache clean --force npm -g i npm@4再试试npm install 就不报错了 ...转载 2018-12-05 21:10:29 · 277 阅读 · 0 评论 -
点击Button实现打开新窗口跳转并且设置窗口大小并居中
1.在template中创建click事件<div class="glyphicon glyphicon-plus-sign" title="点击我新增项目" @click="createnewproject"></div>2.在methods中创建方法methods: { createnewproject() { const routerda...转载 2018-12-05 15:15:28 · 2662 阅读 · 0 评论 -
3.Vue中点击button跳转至新的路由
1.params传参:this.$router.push({name:'parasetEdit',params:{pk_refinfo:'test',value:'test1'}});目标页面接收参数:this.$route.params.pk_refinfo2.query传参:this.$router.push({path:'/uapbd/paraset/edit',query:...转载 2018-11-21 15:11:37 · 13129 阅读 · 2 评论 -
2.vue-cli+webpack的项目中配置bootstrap的方法
原文是:https://www.cnblogs.com/kongxianghai/p/6910133.html感谢博主,转载只为记录脚手架生成项目(同方法一)执行命令用webpack模板生成一个名为vuestrap的项目(名字任意)vue init webpack vuestrap 在出现的各提示选项中,没什么要求,为了方便,把不用的ESLint,unit tests,e...转载 2018-11-21 15:05:29 · 198 阅读 · 0 评论 -
1.Vue脚手架搭建
1.去node.js官网https://nodejs.org/en/下载node.js安装包2.安装node.js,一路点确定即可3.全局安装vue-cli命令:npm install -g vue-cli4.使用vue - help查看命令帮助二、安装完vue-cli脚手架,下面开始创建项目步骤:cd 目录(你要把项目放在哪个目录);vue init we...原创 2018-10-19 09:29:55 · 189 阅读 · 0 评论