这是我的js文件,其中包含我的图像.
import React, { Component } from 'react';
import './Stopka.css';
class Stopka extends Component {
render() {
return (
<div className="container">
<footer className="row">
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h4>Some text</h4>
</div>
<div className="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<img src={require("./icons/name1.png")} alt="" className="img-responsive" />
<img src={require("./icons/name2.png")} alt="" className="img-responsive" />
<img src={require("./icons/name3.png")} alt="" className="img-responsive" />
<img src={require("./icons/name4.png")} alt="" className="img-responsive" />
</div>
</footer>
</div>
);
}
}
export default Stopka;Run Code Online (Sandbox Code Playgroud)
和渲染这个的文件.
import React from 'react';
import ReactDOM from 'react-dom';
import Stopka from './Stopka';
import registerServiceWorker …Run Code Online (Sandbox Code Playgroud)我的查询过滤器
export const resolvers = {
Query: {
allItems: (_, { value }) => getAllLinks()
.then(result => filter(result, val => val.custom_attributes
.find(customVal =>
customVal.attribute_code === 'category_ids' && isEqual(customVal.value, value)
)
)),
},
Run Code Online (Sandbox Code Playgroud)
我的架构
const typeDefs = `
type Item {
id: ID!
name: String
price: Float
custom_attributes: [CUSTOM_ATTRIBUTES]
}
union CUSTOM_ATTRIBUTES = CustomString | CustomArray
type CustomString {
attribute_code: String
value: String
}
type CustomArray {
attribute_code: String
value: [String]
}
type Query {
allItems(value : [String]): [Item]!
}
`; …Run Code Online (Sandbox Code Playgroud)