UNPKG

vue-simple

Version:

Use Vue in the simplest and easiest way, contain more than one of plugins and other to do that, i hope you will like it.

17 lines (14 loc) 297 B
/** * 获取cookie值 * @param key * @returns {String} */ function getCookie(key) { let arr = null; const reg = new RegExp('(^| )' + key + '=([^;]*)(;|$)'); if (arr = document.cookie.match(reg)) { return unescape(arr[2]); } return null; } export { getCookie };