如何修复“对象不支持button.print.min.js的属性或方法'exportInfo'”

时间:2019-05-14 09:15:36

标签: printing datatables

请参考以下脚本来准备表格:

enter image description here

请参考以下加载的js库:

enter image description here

点击打印按钮后,请参考下面的表格和错误的用户界面:

enter image description here

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

引起问题的原因是库的版本不同。

使用以下库引用对其进行修复:

const { graphql } = require('graphql');
const { makeExecutableSchema } = require('graphql-tools');

const typeDefs = `
  type Person {
    name: String!
  }
  extend type Person {
    salary: Int
  }  
  type Query {
    person: Person
  }
`;

const resolvers = {
  Query: {
    person: () => ({ name: "John Doe", salary: 1234 })
  }
}  

const schema = makeExecutableSchema({ typeDefs, resolvers });

graphql(schema, '{ person {name salary} }').then((response) => {
  console.log(response);
});