menu

vue 使用js-hal hal json

  • date_range 07/09/2017 00:00 info
    sort
    Default
    label

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

编辑