Default / 默认 · 8月 31, 2021

“vue 使用js-hal hal json”

内容纲要

In Node.JS

npm install hal
var hal = require('hal');

var resource = new hal.Resource({name: "Harry"}, '/harry');
resource.link('hello', '/harry/hello');
console.log(resource.toJSON());
vue中
import hal from 'hal';
var resource = new hal.Resource({name: "Harry"}, '/harry');
resource.link('hello', '/harry/hello');
console.log(resource.toJSON());

更多查看项目地址 https://github.com/byteclubfr/js-hal


%d 博主赞过: