Lydia's blog

Every day to be a little better


  • Home

  • Archives

  • Search

服务器登录及退出

Posted on 2017-02-21 10:36

服务器登录
root
siwei.tech
-p 35888
Sillyboy12$

ssh root@www.siwei.tech -p 35888

退出:ctrl+d

controller&model文件头尾固定代码&migration文件代码样式

Posted on 2017-02-20 09:14

1.controller
无namespace的:class XxxsController < ApplicationController
有namespace的:class Xxx::XxxsController < ApplicationController
namespace名称::controller名称

2.model
class Xxx < ActiveRecord::Base
end

3.migrate文件中添加
t.字符类型 :字段名,comment: ‘备注’
t.timestamps

rails--路由

Posted on 2017-02-19 22:56

1.restful
get 查询
post 新建
put 修改
delete 删除

2.root path
root to: ‘xxx/xxx’(文件路径)

3.match路径
match ‘xxx/xxx’(http路径名), to: ‘xxx#xxx’(文件路径), via: ‘get’

4.接口
render json: {
key: value,
……
}

5.查看
bunle exec rake routes
过滤想要的
undle exec rake routes | grep “xxx”

sass与css

Posted on 2017-02-15 15:44

在要改全局css文件时要用
$ sass –watch static/sass/pin_tuan_bao.scss:static/css/pin_tuan_bao.css
监听文件,然后在sass文件中更改,就会自动改写到css里

注释:

H5 页面跳转

Posted on 2017-02-15 13:32

2.在标签中写一个click方法
eg:@click=”show_more_lists
在下面的

v-for&v-html&v-model

Posted on 2017-02-14 15:13

1.template标签下

1
2
3
<li v-for="item in items">
{{ item.message }}
</li>
Read more »

rails-API

Posted on 2017-02-14 14:16

后台:
1.添加app/controllers/interface/xxx_controller.rb文件,写上需要的接口(json)
注意事项:
1.index的接口:
模式:循环用map
类别区分:用where
2.show的接口:
模式:不要循环
区分类别:用if/else语句

Read more »

竖形表格

Posted on 2017-02-14 10:12
姓名:
<%= @she_ji_shi.name %>
头像:
<%= @she_ji_shi.avatar %>
手机:
<%= @she_ji_shi.phone %>
口号:
<%= @she_ji_shi.kouhao %>
学号 111 222 333
姓名 leo may ken
班级 111 222 333

HTML实体符号

Posted on 2017-02-12 11:22

  空格
»----- 》

js 前端组件style调用

Posted on 2017-02-09 20:43

1.在对应的component文件中style后面加上需要的style名称
eg:将:style=”style” —–> :style=”[style,tab_item_style]”
在下面的props里面加上style名称
eg: tab_item_style: [String, Object]
2.在需要调用的view页面上标签后面加上style
eg: :tab_item_style=tab_item_style
在下面的sript/data/return里面填上需要的参数
eg: tab_item_style: {
fontSize: ‘20px’,
fontWeight: ‘800’
}

ps:要改swiper-item大小要通过height和sliderHeight这两个参数来改

1…242526…28

Lydia

This is lydia's blog

277 posts
1 categories
46 tags
© 2020 Lydia
Powered by Hexo
|
Theme — NexT.Muse v5.1.4