'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _icon = require('../icon');

var _icon2 = _interopRequireDefault(_icon);

require('./index.less');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var Loading = {
    name: 'SnLoading',
    props: {
        spinning: {
            type: Boolean,
            'default': false
        },
        tip: {
            type: String,
            'default': '加载中...'
        }
    },
    methods: {},
    render: function render() {
        var h = arguments[0];
        var spinning = this.spinning,
            tip = this.tip;


        return spinning ? h(
            'section',
            { 'class': 'sn-loading' },
            [h(_icon2['default'], {
                attrs: { type: 'loading' }
            }), h(
                'div',
                { 'class': 'sn-loading-tip' },
                [tip]
            )]
        ) : null;
    }
};

Loading.install = function (Vue) {
    Vue.component(Loading.name, Loading);
};

exports['default'] = Loading;
module.exports = exports.default;