Skip to content

Instantly share code, notes, and snippets.

@icai
icai / vue.jsx
Created March 24, 2018 13:33
vue.jsx use template better
render(){
let me = this;
return (
<MConfirm>
<div slot="content">
{!this.cancel ? (
<div class="mb-10">
<p>申请单号:{row.orderNo}</p>
<p>供货商名称:{row.providerName}</p>
<p>商品数量:整箱数:{row.carUnit},单件数:{row.carUnit}</p>
@icai
icai / vue.render.vm.js
Created January 11, 2018 12:37
vue render vm
model: {
value: (me.skus.dataSource[index].minUnitPrice),
callback: function($$v) {
me.$set(me.skus.dataSource[index], "minUnitPrice", $$v);
if(me.unitsMultiple
&& me.cartonUnits.dataSource[1].quantity){
var prices = ($$v * me.cartonUnits.dataSource[1].quantity);
me.$set(me.skus.dataSource[index], "wholesalePrice", prices);
}
@icai
icai / vue render vm code
Created January 11, 2018 12:19
vue render vm code
(function() {
with (this) {
return _c('div', {
staticClass: "ui-abox",
attrs: {
"fitBottom": "true"
}
}, [_c('div', {
staticClass: "fixed-btns"
}, [_c('BackTop', {
@icai
icai / pinuhs4pn6s9a25ss2zi3oyn
Created December 22, 2017 14:55
pinuhs4pn6s9a25ss2zi3oyn
pinuhs4pn6s9a25ss2zi3oyn
<Row gutter="30">
<Col span="16" v-if="goodscm3Toggle">
<Form-item label="体积(长宽高):" prop="goodscm3" vtype="int" >
<Row gutter="10">
<Col span="7">
<Input v-model="deliveryData.goodsLength" placeholder="长"></Input>
</Col>
<Col span="7">
<Input v-model="deliveryData.goodsWidth" placeholder="宽"></Input>
</Col>
@icai
icai / datepicker.js
Created October 11, 2016 06:15
vue 2 directive with jqueryui
Vue.directive('datepicker', {
bind: function (el, binding, vnode, oldVnode) {
$(el).datepicker({
onSelect: function (date) {
vnode.context.date = date;
}
});
},
update: function (el, binding, vnode, oldVnode) {
$(el).datepicker('setDate', binding.value);
@icai
icai / easing.js
Last active June 14, 2019 00:32
easing easeOutIn effect
/******************************************************************************/
/*********************************** EASING ***********************************/
/******************************************************************************/
(function() {
// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
var baseEasings = {};
$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
@icai
icai / simulateloading.js
Created August 18, 2016 07:53
simulated Loading, trigger favicon loading
var oldDone = Nprogress.done;
Nprogress.done = function(){
var setfmSrc = function(dom, url){
dom.src = url;
};
var fm = document.getElementById('triggerloading');
var url = "/favicon.ico"; // ping page;
if(fm){
setfmSrc(fm, url);
} else{
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@icai
icai / serverRespCode
Created November 27, 2014 16:01
server responsive code
100: "Continue",
101: "Switching Protocols",
102: "Processing",
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-Authoritative Information",
204: "No Content",
205: "Reset Content",
206: "Partial Content",