Skip to content

Instantly share code, notes, and snippets.

View mrxuyong's full-sized avatar

上官沁廷·轻初于蓝 mrxuyong

View GitHub Profile
@lygaret
lygaret / index.js
Last active January 18, 2023 17:26
ES6 Quasi-Literal for JSX
define(function(require) {
var React = require('react');
var paramRegex = /__(\d)+/;
var parser = new DOMParser();
var errorDoc = parser.parseFromString('INVALID', 'text/xml');
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI;
// turns the array of string parts into a DOM
// throws if the result is an invalid XML document.
@r17171709
r17171709 / gridlayout动态添加
Created July 15, 2015 06:01
gridlayout动态添加
//类似数组[行, 列]
//表示起始位置为0,占据2行
GridLayout.Spec rowSpec=GridLayout.spec(0, 2, GridLayout.UNDEFINED);
//表示起始位置为1,占据1列
GridLayout.Spec columnSpec=GridLayout.spec(i, 1, GridLayout.UNDEFINED);
GridLayout.LayoutParams params=new GridLayout.LayoutParams(rowSpec, columnSpec);
gridlayout.addView(view, params);
此外xml中也要预先定好多少行多少列
@afc163
afc163 / cascader-address-options.js
Last active August 24, 2024 15:24
Address options for antd cascader
import provinces from 'china-division/dist/provinces.json';
import cities from 'china-division/dist/cities.json';
import areas from 'china-division/dist/areas.json';
areas.forEach((area) => {
const matchCity = cities.filter(city => city.code === area.cityCode)[0];
if (matchCity) {
matchCity.children = matchCity.children || [];
matchCity.children.push({
label: area.name,
@mactive
mactive / topview.js
Last active July 11, 2019 02:21
rn-topview
/**
* [email protected]
* 2017-05-08
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,