Giter Club home page Giter Club logo

front_end-demos's Introduction

front_end-demos

前端练手项目,用于记录个人工作学习日常积累的demo。

Name Source Code
koa+mysql实现定时邮件发送小网站
vue-todo-demo项目 code
react-todo-demo项目 code
拖拽框实现文件上传 code
canvas实现一个画板 code
canvas画一个饼状图 code
vue国庆装逼计划h5活动页面(移动端) code
Angular英雄教程 code
各种音频格式测试
HTML5 Audio标签 code
HTML5 Video标签 code
数据结构-JS操作二叉树 code
Leetcode解题思路 code
Node使用protobuf code
Vue使用protobuf code
px2rem code

以下几课来源于有哪些适合新手练手的前端项目?。自己跟着一步一步写下来,源码放在GitHub上,非常感谢原项目作者。 原生JavaScript学习,By Ferris

第一课

第二课

第三课

第四课

front_end-demos's People

Contributors

dependabot[bot] avatar fengxianqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

front_end-demos's Issues

执行npx pbjs -t json src/proto/*.proto > src/proto/proto.json这一步时,并没有生成相应的proto.json

npx pbjs -t json src/proto/*.proto > src/proto/proto.json
npx: installed 3 in 3.694s

cat src/proto/proto.json
Usage: pbjs [options] <schema_path>

Options:
-V, --version output the version number
--es5 <js_path> Generate ES5 JavaScript code
--es6 <js_path> Generate ES6 JavaScript code
--ts <ts_path> Generate TypeScript code
--decode <msg_type> Decode standard input to JSON
--encode <msg_type> Encode standard input to JSON
-h, --help output usage information

生成的内容居然是上面的。不是json

protobufjs
bash: protobufjs: command not found
daviddeMacBook-Pro:vue-protobuf david$ pbjs
bash: pbjs: command not found

但是我protobufjs确实已经安装

ll node_modules/protobufjs
lrwxr-xr-x 1 david staff 47 Dec 8 09:41 node_modules/protobufjs -> .store/[email protected]/node_modules/protobufjs

PBMessageRequest.encode(data).finish()为空的问题

return PBMessageRequest.encode(data).finish();
大佬 data 传过来有值,执行上边的encode之后为空,请问这个是什么问题呢?
`/eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars/
"use strict";

var $protobuf = require("protobufjs/light");

var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root()))
.addJSON({
chenjia: {
nested: {
NativeField: {
values: {
TITLE: 1,
AD_WORDS: 2,
DESC: 3,
IMGS: 4,
ICON: 5,
CLICK_URL: 6,
DOWNLOAD_URL: 7,
DEEP_URL: 8
}
},
BidRequest: {
fields: {
version: {
type: "uint32",
id: 1
},
requestId: {
type: "string",
id: 2
},
test: {
type: "bool",
id: 3,
options: {
"default": false
}
},
sspToken: {
type: "string",
id: 4
},
ip: {
type: "string",
id: 5
},
userAgent: {
type: "string",
id: 6
},
language: {
type: "string",
id: 7
},
category: {
type: "uint32",
id: 9
},
excludedCategory: {
type: "uint32",
id: 10
},
excludeDomain: {
type: "string",
id: 11
},
imp: {
type: "Imp",
id: 12
},
app: {
type: "App",
id: 13
}
},
nested: {
Imp: {
fields: {
adId: {
type: "string",
id: 2
},
size: {
type: "string",
id: 3
},
floorPrice: {
type: "uint32",
id: 4
},
viewType: {
type: "uint32",
id: 5
},
viewScreen: {
type: "ViewScreen",
id: 7,
options: {
"default": "SCREEN_NA"
}
},
video: {
type: "Video",
id: 8
},
native: {
type: "Native",
id: 9
}
},
nested: {
ViewScreen: {
values: {
SCREEN_NA: 0,
SCREEN_FIRST: 1,
SCREEN_SECOND: 2,
SCREEN_THIRD: 3,
SCREEN_FOURTH: 4,
SCREEN_FIFTH: 5,
SCREEN_OTHER: 6
}
},
Video: {
fields: {
videoadStartDelay: {
type: "uint32",
id: 1
},
videoadSectionStartDelay: {
type: "uint32",
id: 2
},
minAdDuration: {
type: "uint32",
id: 3
},
maxAdDuration: {
type: "uint32",
id: 4
}
}
},
Native: {
fields: {
fields: {
type: "NativeField",
id: 1
},
titleMax: {
type: "uint32",
id: 2
},
descMax: {
type: "uint32",
id: 3
},
imageWidth: {
type: "uint32",
id: 4
},
imageHeight: {
type: "uint32",
id: 5
},
imageNums: {
type: "uint32",
id: 6
},
templateId: {
type: "string",
id: 7
}
}
}
}
},
App: {
fields: {
appName: {
type: "string",
id: 1
},
packageName: {
type: "string",
id: 2
},
device: {
type: "Device",
id: 3
}
},
nested: {
Device: {
fields: {
os: {
type: "string",
id: 1
},
osv: {
type: "string",
id: 2
},
deviceType: {
type: "string",
id: 3
},
orientation: {
type: "uint32",
id: 4
},
brand: {
type: "string",
id: 5
},
hwv: {
type: "string",
id: 6
},
operator: {
type: "uint32",
id: 7
},
network: {
type: "uint32",
id: 8
},
h: {
type: "uint32",
id: 9
},
w: {
type: "uint32",
id: 10
},
deviceSize: {
type: "string",
id: 11
},
lon: {
type: "string",
id: 12
},
lat: {
type: "string",
id: 13
},
ip: {
type: "string",
id: 14
},
ipv6: {
type: "string",
id: 15
},
deviceId: {
type: "string",
id: 16
},
mac: {
type: "string",
id: 17
},
androidId: {
type: "string",
id: 18
},
oaid: {
type: "string",
id: 19
},
pin: {
type: "string",
id: 20
}
}
}
}
}
}
},
BidResponse: {
fields: {
version: {
type: "uint32",
id: 1
},
bid: {
type: "string",
id: 2
},
requestId: {
type: "string",
id: 3
},
dspId: {
type: "string",
id: 4
},
ads: {
type: "Ads",
id: 5
}
},
nested: {
Ads: {
fields: {
adId: {
type: "string",
id: 1
},
maxCpmPrice: {
type: "uint32",
id: 2
},
creativeId: {
type: "string",
id: 3
},
ldp: {
type: "string",
id: 6
},
imgurl: {
type: "string",
id: 7
},
attr: {
type: "Attr",
id: 9
},
showUrl: {
type: "string",
id: 10
},
clickUrl: {
type: "string",
id: 11
},
video: {
type: "Video",
id: 13
}
},
nested: {
Attr: {
fields: {
name: {
type: "string",
id: 1
},
value: {
type: "string",
id: 2
}
}
},
Video: {
fields: {
duration: {
type: "uint32",
id: 1
},
url: {
type: "string",
id: 2
},
eventStart: {
type: "string",
id: 3
},
eventMidpoint: {
type: "string",
id: 4
},
eventComplete: {
type: "string",
id: 5
}
}
}
}
}
}
}
}
}
});

module.exports = $root;
`

api 404

请问,请求api 报404 怎么解决

大佬想问您一下关于protobufjs的问题

request.js下'framework.PBMessageRequest'这个是什么怎么得到的呀
// 请求体message
const PBMessageRequest = protoRoot.lookup('framework.PBMessageRequest')
// 响应体的message
const PBMessageResponse = protoRoot.lookup('framework.PBMessageResponse')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.